Python Dictionaries Quiz
- Questions: 15
- Easy
- Pass mark: 70%
A dictionary stores values under names you choose: a crew member's role under their name, a rocket's fuel under each stage, a planet's moons under the planet. This free quiz has 15 short questions on creating, reading, changing and looping over dictionaries in Python, and on the mistakes beginners make most often with keys.
What the quiz covers
- Creating dictionaries and reading values by key
- Missing keys:
KeyError,get()andin - Adding, changing and removing pairs with
update(),pop()anddel - Looping with
keys(),values()anditems() - Counting with a dictionary, lists inside dictionaries and nested dictionaries
How it works
- 15 questions: 11 with one correct answer, 4 where you select every correct answer
- After each question you see the correct answer and a short explanation
- No time limit and no account needed
- Score 70% or more (11 of 15) to pass
Each topic has a runnable example: creating dictionaries, modifying dictionaries, iterating over a dictionary and nested dictionaries. After this one, try the Python Lists Quiz or the Python For Loop Quiz.