Joshua C. answered 04/07/19
Tutor
New to Wyzant
Software Engineer in Bay Area
If you use `defaultdict`, it'll already have the mapping initialized, so you don't need to perform the key check.
from collections import defaultdict
d = defaultdict(str)
d['key'] = 1
d.pop('key') # the "one liner"