CBSE Class 10 Computer Applications
Question 8 of 26
Python Conditionals and Loops — Question 6
Back to all questions 6
Question Question 6
What will the output of following code ?
for i in range(1, 0) :
print i- 0
- 1
- No output
- Error in code
No output
Reason — The function range(1, 0) will return return an empty list [] as no number falls in the arithmetic progression beginning with 1 and ending with 0. Thus, the for loop will not execute even once and hence, no output will be generated on the output screen.