Join free to take this lesson
Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.
13 steps ยท about 20 min
By the end you can
- Write an if with a condition and a colon
- Say which lines an if controls: its indented body
- Indent a line by four spaces, with the Tab key
- Read and fix an IndentationError
- Spot a line that should be in the body but isn't
Who it is for: After lesson 2.1: you can write comparisons such as speed > limit.
The steps
- Fined or not?
- if
- Run it
- Under the limit
- Which line does it control?
- The body: four spaces in
- Write the body
- Forgot the spaces? IndentationError
- Reading the error
- Fix the bug
- Outside the body, it always runs
- The innocent driver
- Why the spaces matter
Discussion 0 comments
Log in to join the discussion.