defaultdict from collections
setdefault
try:
d[key] += x
except IndexError:
d[key] = default
>>> a = {'3':0, 'bbb':0}
>>> a
{'3': 0, 'bbb': 0}
>>> a['3'] += 2
>>> a['bbb'] += 8
>>> a
{'3': 2, 'bbb': 8}
>>> a['3'] += 3
>>> a
{'3': 5, 'bbb': 8}