Problem Statement
Explain break, continue, and pass with examples.
Explanation
The break statement immediately exits the loop, skipping any remaining iterations. continue jumps to the next iteration, skipping only the current one. pass simply does nothing and is used as a placeholder.
These three help control the flow of loops. break is often used when a condition is met, continue is used to skip unwanted cases, and pass keeps structure valid while leaving logic for later.
Code Solution
SolutionRead Only
for i in range(5): if i==2: continue if i==4: break print(i)
