Stage 2 · 30 minutes · Pro
Dictionaries (dict) and sets
Store data by key with dict, count frequencies, loop over items(), get(); remove duplicates with set.
Objectives
- Create, read and change dicts
- Use get() to avoid KeyError
- Count frequencies with dict
- Use set to remove duplicates
Lesson for Pro members
Phone contacts, scores by name, counting how often a word appears: 'key → value' data is everywhere. dict is the most used structure in real Python.
View Pro plans Open in the app