← Python

elif Statements

elif adds extra conditions to check when the preceding if (or elif) was False

What it does: elif is checked only if the previous if was False. elif can use any comparison operator including ==. elif is short for 'else if' — it adds another condition to check. x > 10 is False, so Python checks elif — 5 > 3 is True, so 'Medium' prints. You can chain as many elif blocks as you need. elif must always follow an if — it can't stand alone. x > 5 is True immediately — elif is never even checked. Like if, elif lines must end with a colon.

Common mistakes: Python uses elif, not 'else if' (no space). elif cannot appear without an if statement before it.

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
What does elif stand for?
else ifelse in function
Matches
❌ else if x > 5: print('mid')
Error: Use elif not 'else if'
Applying
Meanings
Term
elif
Meaning
Short for 'else if' - checks another condition if the previous was False.
Practice
x = 5
Testing
Gaps
x > 5:
Check Answer
Spots
2 print('Big')
3else if x > 5:

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

The 'Lion' badge — Inheritance King, 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. What does elif stand for?
A. else if ✓
B. else in function
elif is short for 'else if' — it adds another condition to check
2. When does an elif block run?
A. Always
B. When the if above is False and elif is True ✓
elif only gets checked when all previous if/elif conditions were False
3. x = 5\nif x > 10:\n print('Big')\nelif x > 3:\n print('Medium')\nWhat prints?
A. Medium ✓
B. Big
x > 10 is False, so Python checks elif — 5 > 3 is True, so 'Medium' prints
4. Can you have multiple elif blocks?
A. No
B. Yes ✓
You can chain as many elif blocks as you need
5. Can elif appear before if?
A. No if must come first ✓
B. Yes
elif must always follow an if — it can't stand alone

Match the Pairs

else if x > 5: print('mid') Error: Use elif not 'else if'
elif x > 5 print('mid') Error: Missing colon after elif
if x > 10: print('big') elif x > 5: print('mid') Valid: elif checks next condition
elif score == 100: print('perfect') Ok: elif with == comparison
x = 7 if x > 10: print('big') elif x > 5: print('mid') Output: mid
x = 15 if x > 10: print('big') elif x > 5: print('mid') Output: big

Key Term

elif
Short for 'else if' - checks another condition if the previous was False.~~Chaining

Fill in the Blanks

1. if x > 10: print('Big') elif x > 5: print('Medium')
2. if score >= 90: print('A') elif score >= 80: print('B')
3. if age >= 18: print('Adult') elif age >= 13: print('Teen')
4. if temp >= 35: print('Hot') elif temp >= 25: print('Warm')
5. if day == 'Monday': print('Start') elif day == 'Saturday': print('Weekend')

Spot the Error

Question 1
A if x > 10:
B print('Big')
C else if x > 5:
D print('Medium')
Line C — Python uses elif, not 'else if' (no space)
Question 2
A x = 7
B elif x > 5:
C print('Medium')
Line B — elif cannot appear without an if statement before it
Question 3
A if x > 10:
B print('Big')
C elif x > 5
D print('Medium')
Line C — Missing colon at the end of the elif line
Question 4
A if x > 10:
B print('Big')
C Elif x > 5:
D print('Medium')
Line C — elif must be lowercase — Elif is not valid Python
Question 5
A if x > 10:
B print('Big')
C elif x > 5:
D print('Medium')
Line D — The print inside elif 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?