intermediateconceptual6 min
How do dictionaries work in Python?
How do dictionaries work in Python and why are they useful?
Expected Answer
Dictionaries store key-value pairs and provide fast lookup by key for hashable keys.
Detailed Explanation
A strong answer mentions key uniqueness, hashability, common operations, and practical use cases such as configuration, counts, and profiles.
Common Follow-up Questions
- What can be used as a key?
- How would you count values?