Python · Lesson 5.3 · Pro

Totals, counts and running bests

The accumulator pattern: start with a value before the loop and update it on every pass.

In this lesson

  1. A running total
  2. A counter
  3. The best so far
  4. Running totals