Question 3
Back to Exercise
What is the output of the following Python program?
for i in range(1, 8):
if i % 3 == 0:
continue
print(i, end=" ")
print()
- A 1 2 4 5 7 Correct
- B 1 2
- C 3 6
- D 1 2 3 4 5 6 7
Correct Answer: Option A
continue skips the print for 3 and 6 and moves on; it does not end the loop.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!