else Statements, online
Six activities your students do on their own devices. See who's finished, and their scores.
Learning
Understanding
Testing
else Statements in one minute
What students need to know
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.
Mistakes students make
- else does not take a condition just else: with no expression.
- Missing colon after else.
- else cannot stand alone it must follow an if or elif.
- else must be lowercase Else is not valid Python.
What students will learn in this module
Every question in Module 16
Quick questions
- When does else run?AAlwaysBWhen all if/elif conditions are False
- Does else have a condition?AYesBNo it catches everything left
- x = 2\nif x > 10:\n print('Big')\nelse:\n print('Small')\nWhat prints?ASmallBBig
- Where must else appear?AAfter the last if or elifBBefore if
- Can you have else without if?ANoBYes
Key terms
Students type the meaning of:
elseif/elseif/elif/else
Match the pairs
else x > 5:
print('no')Match it to what it doeselse:
print('no')
elif x > 2:
print('mid')Match it to what it doesif x > 0:
print('pos')
else:
print('neg')Match it to what it doeselse:
print('other')Match it to what it doesx = 2
if x > 5:
print('big')
else:
print('small')Match it to what it doesx = 8
if x > 5:
print('big')
else:
print('small')Match it to what it doesFill in the blanks
if x > 10: print('Big') ____: print('Small')if age >= 18: print('Adult') else_ print('Minor')if score >= 50: print('Pass') ____: print('Fail')if name == 'Alice': print('Hi') ____: print('Unknown')if temp >= 30: _____('Hot') else: print('Cold')
Spot the error
Question 1
Aif x > 10:B print('Big')Celse x <= 10:D print('Small')
Question 2
Aif x > 10:B print('Big')CelseD print('Small')
Question 3
Aelse:B print('Small')
Question 4
Aif x > 10:B print('Big')CElse:D print('Small')
Question 5
Aif x > 10:B print('Big')Celse:Dprint('Small')
