← Quiz: Python Loops: all 13 questions
Quiz: Python Loops · Question 3 of 13
What does this print? (code)
What does this print?
i = 0
while i < 5:
i += 2
print(i)
- A.4
- B.5
- C.6
- D.2
Answer & explanation
Correct answer: 6
i goes 0 → 2 → 4 → 6. At 6 the condition fails and the loop ends.
Can you get the rest right without peeking?
Take the timed Quiz: Python Loops quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →