Skip to content

Instantly share code, notes, and snippets.

View maxkleiner's full-sized avatar

Max Kleiner maxkleiner

View GitHub Profile
@maxkleiner
maxkleiner / defaultdictstat
Created November 1, 2019 11:18
defaultdict_stat DefaultDict is a dictionary that is initialized with a default value when each key is encountered for the first time.
from collections import defaultdict
for letter in 'the red fox ran as fast as it could':
my_default_dict[letter] += 1