Y
Hacker News
new
|
ask
|
show
|
jobs
by
basdftrewq
1986 days ago
from collections import defaultdict d = defaultdict(int) d['non_existant_key']
1 comments
st0le
1986 days ago
Not quite the same what OP asked for. This will create the key and assign value 0 to it.
link