Skip to Content
Nextra 4.0 is released 🎉
ActivitiesDictionary Fill in the Blank

Dictionary Fill in the Blank

Practice building dictionaries by filling in missing keys and values.


Part 1 — Fill in the blanks

The dictionary below is missing some keys and values. Fill in each ____ with the correct answer. You can Google anything you don’t know.

movie = { "title": "The Dark Knight", "____": 2008, "genre": "____", "____": "Christopher Nolan", "cast": ["Christian Bale", "____", "Aaron Eckhart"] }

Topics covered: What is a Dictionary?


Part 2 — Build your own

Now create a dictionary for a movie of your choice. Use the same fields.

movie = { "title": "", "year": ____, "genre": "", "director": "", "cast": ["", "", ""] }

Topics covered: Accessing Dictionary Values


Part 3 — Loop through your dictionary

Dictionaries have a .items() method that lets you loop through every key-value pair — the same way you loop through a list.

Topics covered: Looping over a Dictionary

Last updated on