I created a dictionary a
and tried to use method keys()
to return its keys. Below is what I got. I notice the output of keys()
are not in alphabetical order or original order as in the dictionary.
a
Out[1]: {1: 'JAN', 2: 'FEB', 3: 'MAR', 'APR': 4, 'MAY': 5}
a.keys()
Out[2]: ['APR', 1, 2, 3, 'MAY']
Anyone could help me understand why this happens. and what's the order keys() is using here?