Lesson 59 of 79 · 15 minutes
Looping and counting with dictionaries: Vote Counter
Votes pour in, and the tally board climbs. A dictionary is the perfect way to count things.
This game is part of the full course.You own the full course.
Unlock all 79 Python coding games for $9, once.Opening the game…
Unlock for $9Play now
What you'll learn
- Looping over a dictionary
- Just the keys, or just the values
- Adding one to a count
- Counting everything
- Adding to a key that isn't there
Each idea opens with a short narrated video, about 2 minutes in all. Then you put it to work in the game.
The six levels
- Read the Board Change it
- Total Turnout Copy and type
- One More Vote Fill the gap
- Count Them All Write it
- The First Vote Fix it
- Election Night Boss level
The levels go from changing one word, to writing the code on your own. The boss level changes every time you play.
New to Python? Start with the free games in Module 1.