Question-98: When you run below program, how many lines would be printed on console?
for i in range(1,1):
print("This line would ever printed", i)
for i in range(2,1):
print("This line would ever printed", i)
for i in range(-2,1):
print("This line would ever printed", i)
- 0
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer: D
Exp:
for i in range(1,1): print("This line would ever printed", i)
You can access to full explanation to question and answer from this page. |
- In range function if both 1st and 2nd argument same. This would never be executed.
- 2nd Argument must be bigger than first one, if you want to have some iterations.
-
You can access to full explanation to question and answer from this page.