Card 4: Booleans
Module 2: Making Decisions
1 The Hook
A Boolean is like a Light Switch.
It can only be in one of two states:
- True (On)
- False (Off)
2 Worked Example
We can store True/False directly, or ask a question to get one.
PREDICT
What will this code print?
print(score > 200)
Input Required
Interactive Editor
🥉 Make it True
1. Copy the code.
2. Change the Operator (>) to make the answer
True.
(Hint: Use < for "less than").
print(50 > 100)
🥈 Capital City
This code has 2 errors.
1. Python case-sensitivity (true vs True).
2. Assignment order (variable on left).
🥇 Age Checker
1. Ask user for their age (remember int()!).
2. Create a variable old_enough that checks if age >= 18.
3. Print old_enough.