In this lesson
- It starts with a question. You want to count how many of each fruit a stall sold. What shape fits best?
- The idea you will find. Start at zero when the key is new. — The whole pattern is: look up the current count, treat a missing key as zero, add one, put it back. It handles names nobody anticipated, which is why it is the standard way to tally anything — words, votes, errors in a log.
- Length. 5 short steps. Progress saves on this phone.
Part of Python: Lists & Dictionaries
Choosing how to store data so the thing you do most often is the thing that is easy.