Loops are powerful, but sometimes you need more control over how they behave. What if you want to stop a loop early when a certain condition is met? Or skip one specific iteration without stopping the whole loop?
Python provides three loop control statements — break, continue, and pass that give you precise control over loop execution. They are simple to use but make a significant difference in writing efficient and logical code.
The break Statement
The break statement immediately exits the loop when a specified condition is met, regardless of how many iterations remain. Execution continues with the code that comes after the loop.
Syntax:

Example — Stop when a number is found:

The loop stops completely as soon as num equals 7.
Example — break in a while loop:


Here, break is what prevents the infinite while True loop from running forever.
The continue Statement
The continue statement skips the rest of the current iteration and jumps directly to the next one. Unlike break, it does not stop the loop — it just moves past the current cycle.
Syntax:

Example — Skip even numbers:


Even numbers are skipped; the loop continues with the remaining values.
Example — Skip a specific name:


The pass Statement
The pass statement does nothing, it is a placeholder. Python requires that code blocks cannot be empty, so pass is used when a block is syntactically required but you have no code to put there yet.
Syntax:

Example — Empty loop placeholder:

No output is produced. The loop runs and completes without doing anything.
Example — Placeholder in a condition:

pass is commonly used during development when you are building the structure of your code before filling in the logic.
Practical Example — Combining All Three


1. Even numbers are skipped by continue.
2. Number 5 hits pass and still prints.
3. Loop stops before printing 8 due to break.
Common Mistakes to Avoid
1. Using break when you only want to skip — use continue instead.
2. Forgetting that continue still keeps the loop running.
3. Leaving empty code blocks without pass — Python will raise an IndentationError.
We have a sales campaign on our promoted courses and products. You can purchase 1 products at a discounted price up to 15% discount.