What will be the output of the following Python code?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1A. 1 2 3 4 5 6
B. 1 2 3 4 5 6 7
C. error
D. none of the mentioned
Answer: Option A
Related Questions on Conditional Formatting (While and For Loops)
Which loop in Python is ideal for situations where you don't know the number of iterations?
A. For Loop
B. While Loop
C. Do-While Loop
D. Infinite Loop
What is the output of the following code snippet:for i in range(2, 6):
print(i)
A. 2
3
4
5
B. 1
3
4
6
C. 3
4
5
6
D. 1
2
3
4
Which loop is known for its pre-checking condition?
A. For Loop
B. While Loop
C. Do-While Loop
D. Infinite Loop
What is the purpose of the break statement in loops?
A. Exit the loop
B. Skip the current iteration
C. Continue to next iteration
D. Pause the loop

Join The Discussion