← Python

else Statements

else runs a code block when all preceding if/elif conditions were False

What it does: else runs when the if condition is False — guarantees one block always runs. else needs only a colon — no condition, no parentheses. else must always come last — after all if and elif blocks. else must follow an if — it can't exist on its own. 100 > 50 is True — if runs, else is skipped. 75 < 90 and 75 < 80 — neither if nor elif match, so else runs. There can only be one else per if statement. else never has a condition — it catches everything not matched above.

Common mistakes: else does not take a condition just else: with no expression. Missing colon after else.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
When does else run?
When all if/elif conditions are FalseAlways
Matches
❌ else x > 5: print('no')
Error: else has no condition
Applying
Meanings
Term
else
Meaning
Catch-all block that runs when all if/elif conditions are False. else never has a condition - just else: with a colon.
Practice
x = 5
Testing
Gaps
:
Check Answer
Spots
2 print('Big')
3else x <= 10:

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Pufferfish' badge — Error Handler, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. When does else run?
A. When all if/elif conditions are False ✓
B. Always
else is the fallback — it only runs when nothing above matched
2. Does else have a condition?
A. Yes
B. No it catches everything left ✓
else has no condition — it runs for everything not caught by if/elif
3. x = 2\nif x > 10:\n print('Big')\nelse:\n print('Small')\nWhat prints?
A. Small ✓
B. Big
2 > 10 is False, so the if is skipped and else runs
4. Where must else appear?
A. Before if
B. After the last if or elif ✓
else must always come last — after all if and elif blocks
5. Can you have else without if?
A. No ✓
B. Yes
else must follow an if — it can't exist on its own

Match the Pairs

else x > 5: print('no') Error: else has no condition
else: print('no') elif x > 2: print('mid') Error: elif can't come after else
if x > 0: print('pos') else: print('neg') Valid: else as fallback
else: print('other') Ok: else with colon only
x = 2 if x > 5: print('big') else: print('small') Output: small
x = 8 if x > 5: print('big') else: print('small') Output: big

Key Term

else
Catch-all block that runs when all if/elif conditions are False. else never has a condition - just else: with a colon.~~if/else

Fill in the Blanks

1. if x > 10: print('Big') else: print('Small')
2. if age >= 18: print('Adult') else: print('Minor')
3. if score >= 50: print('Pass') else: print('Fail')
4. if name == 'Alice': print('Hi') else: print('Unknown')
5. if temp >= 30: print('Hot') else: print('Cold')

Spot the Error

Question 1
A if x > 10:
B print('Big')
C else x <= 10:
D print('Small')
Line C — else does not take a condition just else: with no expression
Question 2
A if x > 10:
B print('Big')
C else
D print('Small')
Line C — Missing colon after else
Question 3
A else:
B print('Small')
Line A — else cannot stand alone it must follow an if or elif
Question 4
A if x > 10:
B print('Big')
C Else:
D print('Small')
Line C — else must be lowercase Else is not valid Python
Question 5
A if x > 10:
B print('Big')
C else:
D print('Small')
Line D — The print inside else must be indented
For Teachers

Create a free class, add this module to a journey, and track who's stuck.

Create a free teacher account →

No credit card. No setup fee. Make a class and invite students in under three minutes.

For Students

Practice this topic interactively, track progress, and unlock badges.

Start Learning Free →

Have a class code?