Courses/Collections & Stdlib Toolbox

๐Ÿงฐ Collections & Stdlib Toolbox

defaultdict

Auto-create missing keys with a default value.

defaultdict(list) creates an empty list whenever you touch a new key โ€” perfect for grouping.

main.py
Output
Press Run to execute.
Expected output
a ['apple', 'ant']
b ['banana', 'blueberry']
c ['cherry']

Sign in to track your progress across lessons.