Loading

Quipoin Menu

Learn • Practice • Grow

Direction: Choose the correct option

Q1.

What does the `break` statement do?
A. Terminates the loop immediately
B. Restarts the loop
C. Exits the program
D. Skips the current iteration
Direction: Choose the correct option

Q2.

What does the `continue` statement do?
A. Exits the program
B. Skips the rest of the current iteration
C. Restarts the loop
D. Terminates the loop
Direction: Choose the correct option

Q3.

What is the purpose of the `else` clause in a loop?
A. Executes if the loop never runs
B. Executes after each iteration
C. Executes only if break occurs
D. Executes if the loop terminates normally (without break)
Direction: Choose the correct option

Q4.

Given `for i in range(3): if i==1: break; print(i)`, what prints?
A. 0 1 2
B. 0
C. 0 2
D. 0 1
Direction: Choose the correct option

Q5.

What does the `pass` statement do?
A. Exits the loop
B. Skips iteration
C. Does nothing
D. Raises an error
Direction: Choose the correct option

Q6.

What will `for i in range(3): if i==1: continue; print(i)` output?
A. 0 2
B. 1 2
C. 0 1 2
D. 0 1
Direction: Choose the correct option

Q7.

What is the result of `while False: pass else: print('done')`?
A. nothing
B. done
C. Error
D. pass
Direction: Choose the correct option

Q8.

Can you use `else` with a `while` loop?
A. Only with `for`
B. Yes
C. No
D. Only with `if`
Direction: Choose the correct option

Q9.

How do you break out of a nested loop completely?
A. Use `pass`
B. Use `break` with a flag or wrap in a function
C. Use `continue`
D. Use `break` twice
Direction: Choose the correct option

Q10.

What does the `exit()` function do?
A. Exits the loop
B. Raises an exception
C. Skips iteration
D. Exits the Python interpreter