R4RIN
Articles
Java 8
MCQS
Python MCQ Quiz Hub
Python MCQS - loops in python
Choose a topic to test your knowledge and improve your Python skills
1. Which of the following is the loop in python ?
for
while
do while
1 and 2
2. for loop in python are work on
range
iteration
Both of the above
None of the above
3. What we put at the last of the loop ?
semicolon
colon
comma
None of the above
4. For loop in python is
Entry control loop
Exit control loop
Simple loop
None of the above
5. To break the infinite loop , which keyword we use ?
continue
break
exit
None of the above
6. which of the following is consider as a infinite loop ?
while(infinte):
while(1):
for(1):
None of the above
7. How many times it will print the statement ?, for i in range(100): print(i)
101
99
100
0
8. What is the final value of the i after this, for i in range(3): pass
1
2
3
0
9. What is the value of i after the for loop ?, for i in range(4):break
1
2
3
0
10. l=[],for i in l: print(l), what is the output ?
[]
list
print()
None of the above
11. while(1): print(2), How many times a loops run ?
1
2
3
None of the above
12. While(0), how many times a loop run ?
0
1
3
infinite
13. while(1==3):, how many times a loop run ?
0
1
3
infinite
14. for i in range(-3), how many times this loop will run ?
0
1
Infinite
Error
15. for i in [1,2,3]:, how many times a loop run ?
0
1
2
3
16. Which of the following is Exit control loop in python ?
for loop
while loop
do while loop
None of the above
17. In which of the following loop in python, we can check the condition ?
for loop
while loop
do while loop
None of the above
18. Which of the following loop is work on the particular range in python ?
for loop
while loop
do while loop
recursion
19. Which of the following loop is not supported by the python programming language ?
for loop
while loop
do while loop
None of the above
20. It is possible to create a loop using goto statement in python ?
Yes
No
Sometimes
None of the above
Submit