CurriculumPython while Loops, break and continue for Kidscontinue — skipping just one

Python continue vs break: What's the Difference?

break stops everything. continue skips just this one pass and keeps going.

Lesson 3 of 5PROAges 10+
See what PRO unlocks →

continue — skipping just one

break stops a loop completely. continue is gentler — it skips just ONE pass, and the loop keeps running.

continue jumps straight to the NEXT pass, skipping whatever comes after it in the loop body.

room = 1
while room <= 5:
    if room == 3:
        room = room + 1
        continue
    print(room)
    room = room + 1

Output

1
2
4
5

Room 3 never got printed — continue skipped straight past print(room) that one time. But the loop kept going: 4 and 5 still print.

room = 1
while room <= 5:
    if room == 3:
        room = room + 1
        continue
    print(room)
    room = room + 1

The trap: if you continue WITHOUT updating the condition first, the loop gets stuck skipping the same pass forever.

Compare the two, side by side: break ends the loop entirely. continue just skips ahead to the next pass.

Check your understanding

room=1..5. room 3 gets 'continue'd (with the update done first). Does 4 and 5 still print?

room = 1
while 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 running
  • 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.

What you'll practice

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.

Unlock this lesson with PRO →

More from this topic

continue — skipping just one is one lesson inside Python while Loops, break and continue for Kids — see the full lesson order and what the whole topic covers.

View the full topic →