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
- Keep a running total in a loop: start before, add inside, print after
- Write total += x for total = total + x
- Count the times something happens, with count += 1
- Put an if inside a loop, with its body pushed in twice
- Fix a total that is reset or added outside the loop
Who it is for: After lesson 2.4: you can write a for loop with range.
The steps
- Adding up in a loop
- A running total
- 1 + 2 + ... + 100
- += : add to
- Add to
- A bike ride
- Where each line goes
- Back to zero
- Galileo's rolling ball
- Counting
- Eight spaces
- Count the slow seconds
- In your own words
Discussion 0 comments
Log in to join the discussion.