import collections mydict = collections.defaultdict(str) range_val = [str(i).zfill(2) for i in range(100)] for v in range_val: mydict[v] = mydict[v] + 1