for i in range(2):
print(i,end="")
for i in range(4,6):
print(i,end="" )
Answers
Answered by
1
Output
for i in range(2):
print(i,end="")
The output will be
- 01
About the above programme
- Its range is from 0 to 1
- you have given only ending index that is 2 i.e by default it will start from 0 and end at 1 less then one from the end index.
- in 'end' you have not given any space and because of that the output will have no space
- 'end' is to make the cursor in the same line
for i in range(4,6):
print(i,end="" )
The output will be
- 45
About the above programme
- Its range is from 4 to 5
- you have given ending as well as starting index, starting index is 4 ending index is 6 i.e its range will be from 4 to 5 less then one from the end index.
- In 'end' you have not given any space and because of that the output will have no space
- 'end' is to make the cursor in the same line
Similar questions
Math,
6 months ago
English,
6 months ago
Computer Science,
1 year ago
Physics,
1 year ago
Business Studies,
1 year ago
Science,
1 year ago