Skip to content

2.3.3 Loop Control Statements (break / continue / pass)

Loop control statements change the normal flow of a loop.
They provide fine-grained control over loop execution.


break

The break statement:

  • Immediately exits the loop
  • Skips all remaining iterations

continue

The continue statement:

  • Skips the current iteration
  • Continues with the next iteration

pass

The pass statement:

  • Does nothing
  • Acts as a placeholder where a statement is required syntactically

📌 Note:
Use loop control statements carefully to keep loop logic clear and predictable.