In Python, I see people creating dictionaries like this:
d = dict( one = 1, two = 2, three = 3 )
What if my keys are integers? When I try this:
There are also these 'ways':
>>> dict.fromkeys(range(1, 4)) {1: None, 2: None, 3: None} >>> dict(zip(range(1, 4), range(1, 4))) {1: 1, 2: 2, 3: 3}