Python continue vs break: What's the Difference?

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

  • Lesson 3 of 5
  • PRO
  • Ages 10+
  • 3 hands-on levels
See what PRO unlocksA one-time $49.99 purchase. Topics 1–3 are free.

The dragon explains

continue — skipping just one

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

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

    example.pyPython 3
    room = 1while room <= 5:    if room == 3:        room = room + 1        continue    print(room)    room = room + 1
    Output1 2 4 5
  3. The 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 3
    room = 1while room <= 5:    if room == 3:        room = room + 1        continue    print(room)    room = room + 1
  4. The dragon: The trap: if you continue WITHOUT updating the condition first, the loop gets stuck skipping the same pass forever.

  5. 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.

  1. 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 3
    room = 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. 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. +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 PRO

Stuck three times? The game offers the answer — unasked.