Concept
Skipping Turns (continue)
Unlike `break`, `continue` does not terminate the loop. It only skips the rest of the **current turn** and jumps straight to the next cycle:
python
for n in range(5):
if n == 2:
continue # Skips 2!
print(n) # Prints: 0, 1, 3, 4
# 61. Skipping Turns (continue) Unlike `break`, `continue` does not terminate the loop. It only skips the rest of the **current turn** and jumps straight to the next cycle: ```python for n in range(5): if n == 2: continue # Skips 2! print(n) # Prints: 0, 1, 3, 4 ``` Use `continue` to ignore bad records without killing your entire batch.
Checkpoint
How does `continue` differ from `break`?
Practice
Loop over `numbers = [1, 2, 3, 4, 5]`. If a number is `3`, skip it with `continue`. Print the rest.
01
Tap code blocks below to assemble
Available Blocks