The intended way to check for the existence of a key in a dictionary is to use in, such as :
d = dict()
for i in xrange(100):
key = i % 10
if key in d:
d[key] += 1
else:
d[key] = 1
for a default value you can use dict.get() as such:
d = dict()
for i in xrange(100):
key = i % 10
d[key] = d.get(key, 0) + 1