Python if, elif and else for Kids
An if statement lets a program do something only in certain situations, instead of doing the same thing every time.
- 16 exercises
- 5 lessons
- Ages 10+
- PRO
This topic is part of PRO — a one-time $49.99 purchase, no subscription. Topics 1–3 are free, start to finish, and the first level needs no account.
For parents & teachers
What this topic covers
Before a child can write an if statement, they need to believe that a comparison like gold > 100 is itself a value — something Python works out to True or False, the same way it works out 40 + 2. The topic starts there, with comparisons on their own, before any if appears.
Then comes if by itself: doing something when a question is True, and nothing at all when it is not. That 'and nothing at all' is deliberately given its own space, because a branch that does nothing visible is genuinely harder to reason about than one that does something.
elif and else follow, and with them the idea that the order of checks matters — a chain that tests the loosest condition first will never reach the more specific ones below it. That is the single most common source of 'my code runs but gives the wrong answer' at this level, so the closing challenge is built specifically to expose it.
Built around a real misconception
The mistake this topic is built to fix
A child believes every branch of an if/elif/else runs, one after the other, like ordinary lines of code.
Why the topic is built around it
This is a documented and stubborn misconception: the child reads the code top to bottom and assumes each line executes in turn. The topic uses cases where a wrong order produces a plausible-looking but wrong answer, so the mistake is visible rather than silent.
gold = 42if gold > 100: print("Rich")else: print("Not yet")
Explain · Ask · Guided · Practice
The lessons, in order
Each lesson explains one idea in short steps, checks it landed with a question, walks through a guided first try, then leaves the child to practise on their own.
True or False — how the dragon tests a value before deciding anything.
- Explain
- Ask
- Guided 1 level
- Practice 3 levels
Doing something only when a question is True — and nothing when it isn't.
- Explain
- Ask
- Guided 1 level
- Practice 2 levels
Chains of decisions — and why the ORDER and the KIND of check both matter.
- Explain
- Ask
- Guided 1 level
- Practice 2 levels
Lesson 4: The Dragon Council
Topic challengeJudge every dragon fairly — one title each, even the tricky ones.
- Explain
- Ask
- Guided 1 level
- Challenge 2 levels
Why elif's ORDER can make a branch impossible to reach — and when separate ifs are the right call instead.
- Explain
- Ask
- Guided 1 level
- Practice 2 levels
Lessons unlock in order within a topic, so nothing arrives before the idea it depends on. This topic is part of PRO — $49.99 unlocks it along with everything else.
Try it now
The very first level needs no account at all — see whether it clicks before signing up for anything.
Play the first level free