The dragon explains
continue — skipping just one
The dragon: break stops a loop completely. continue is gentler — it skips just ONE pass, and the loop keeps running.
The dragon: continue jumps straight to the NEXT pass, skipping whatever comes after it in the loop body.
example.pyPython 3room = 1while room <= 5: if room == 3: room = room + 1 continue print(room) room = room + 1
Output1 2 4 5The dragon: Room 3 never got printed — continue skipped straight past print(room) that one time. But the loop kept going: 4 and 5 still print.
example.pyPython 3room = 1while room <= 5: if room == 3: room = room + 1 continue print(room) room = room + 1
The dragon: The trap: if you continue WITHOUT updating the condition first, the loop gets stuck skipping the same pass forever.
The dragon: Compare the two, side by side: break ends the loop entirely. continue just skips ahead to the next pass.
Quick check
Check your understanding
Say your answer out loud before reading the marked one. Every wrong option is a mistake real beginners make.
Question 1 of 1
room=1..5. room 3 gets 'continue'd (with the update done first). Does 4 and 5 still print?
question.pyPython 3room = 1while room <= 5: if room == 3: room = room + 1 continue print(room) room = room + 1
- Yes — continue only skips room 3's print, the loop keeps runningCorrect
- No — continue ends the loop, same as break
- No — continue causes an error because room 3 was never printed
Why: continue skips only room 3's print and update-then-loop-again — everything after it in the loop keeps happening on later passes. 1, 2, 4, 5 all print; only 3 is missing. That's the difference from break, which would have ended the whole loop right there.
In the game
What you'll practice
Three levels in the game: one guided first try with the shape of the answer already there, then two to solve on your own.
- 1
GuidedYour first try
The dragon checks rooms 1 through 5, but room 3 is locked — skip it entirely (don't print it), then keep checking the rest. Print every OTHER room number.
- +2
PracticeTwo more, on your own
This lesson is part of PRO.
PRO is a one-time $49.99 purchase, no subscription, and unlocks this whole topic along with everything else. Topics 1–3 are free, start to finish.
Unlock this lesson with PROStuck three times? The game offers the answer — unasked.