continue Skip iteration
Last updated: 2026-09-22
continue Skip iteration
continue jumps to the next loop iteration.
| Category | Keywords & Statements |
|---|---|
| Kind | Keyword / Statement |
| Python Version | all |
📝 Syntax
continue
▶ Example
Edit the code, press Run, and see the result in the output panel:
Output:
1
3
🏷️ Related Keywords / Statements
💡 Related Cases
More case studies coming soon — check back later.
❓ FAQ
QCan you write code after `continue`?
AYou can write it, but it will never run, because `continue` jumps to the next iteration and skips all remaining statements of the current one. Such code is dead code; put the statements you want to execute before `continue`.
QWhat pitfall does `continue` have inside `while`?
AIf `continue` skips the statement that updates the loop condition, the condition never changes and you get an infinite loop. Before writing `continue` in a `while`, make sure the condition-updating statement runs before the `continue`.
QWhat is the difference between `continue` and `pass`?
A`continue` skips the remaining statements of the current iteration and moves to the next one; `pass` does nothing — it is just syntactic placeholder and execution continues downward. The two behaviors are completely different.