1 · Python concept
The idea
| integer counter | A whole-number value that records how many actions have happened. Start count at 0. |
|---|---|
| update | count = count + 1 reads the old value, adds one, and stores the new value. |
| loop | Repeats the indented update once for each value supplied by range. |
| off-by-one | Doing one update too few or too many, so success happens one step too early or late. |
| assertion | assert count == goal checks the expected final count. A false check raises AssertionError; a true check is silent. |