Q:

increment dic with for loop

a = defaultdict(int)
a['asdf'] += 1
# a['asdf'] will now be 1, since it updates from 0
0

New to Communities?

Join the community