defaultdict with value i+1 code example Example: python defaultdict default value d = defaultdict(lambda:1)