🧩Break Statement
Also known as break, continue, Break and Continue
A line that stops a loop at once. Its partner continue skips to the next pass.
Think of it like
Think of it like a search for lost keys. Once you find them, you stop looking in the other rooms.
Example
A search loops over 10,000 users looking for one email. It finds it at user 12 and breaks, so it never checks the other 9,988.
Why it matters
Stopping early can save a lot of time on long lists. It is also the clean way out of a loop meant to run forever.
Definition
Example code
python
for n in [4, 9, 2, 7]:
if n == 2:
print("found 2")
break
print("checked", n)