Phase 1 — Core Foundations
break, continue & pass
Controlling loops, plus Python's "do nothing yet" keyword
break
Same concept as JS — stops the loop completely.
for i in range(10):
if i == 5:
break
print(i)0
1
2
3
4continue
Skips the rest of this iteration and moves to the next one.
for i in range(5):
if i == 2:
continue
print(i)0
1
3
4pass
This one is Python-specific — you'll occasionally see it.
def some_function():
passIt means "do nothing for now." It's useful when you need syntactically valid code but haven't implemented the logic yet:
if condition:
pass