$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #192

What goes in the blank?

# group values under a key, no KeyError
from collections import defaultdict
by = ____(list)

Answer: defaultdict (also accepted: defaultdict, defaultdict())

defaultdict(list) creates an empty list on first access to a key.
Play Problem Solving ▸