We use cookies to enhance your browsing experience.

Learn More
Back to Library
PYTHONpython

Default Dictionary

Dict with default values.

from collections import defaultdict

d = defaultdict(int)
d['a'] += 1
print(d['a']) # 1
python dict collections
25+Total Tools
Operations
4Languages
100%Privacy

We use cookies to enhance your experience and serve personalized ads.