Lesson 23 of 79 · 15 minutes
if and else: Fork in the Road
A traveller reaches a fork. One path or the other, never both: your code decides.
This game is part of the full course.You own the full course.
Unlock all 79 Python coding games for $9, once.Opening the game…
Unlock for $9Play now
What you'll learn
- Otherwise: else
- Exactly one path runs
- Testing for even or odd
- Why not just use two ifs?
Each idea opens with a short narrated video, about 2 minutes in all. Then you put it to work in the game.
The six levels
- The Other Way Change it
- The Toll Road Copy and type
- Even or Odd Fill the gap
- Ask the Traveller Write it
- The Gap Fix it
- The Long Road Boss level
The levels go from changing one word, to writing the code on your own. The boss level changes every time you play.
New to Python? Start with the free games in Module 1.