python - How to index into a dictionary? - Stack Overflow 137 Dictionaries are unordered in Python versions up to and including Python 3 6 If you do not care about the order of the entries and want to access the keys or values by index anyway, you can create a list of keys for a dictionary d using keys = list(d), and then access keys in the list by index keys[i], and the associated values with d[keys
enumerate () for dictionary in Python - Stack Overflow Python does not guarantee key order when using enumerate; it is potentially possible for keys to be emitted in a different order on subsequent runs @roadrunner66's answer is the most correct solution