I know we use enumerate for iterating a list but I tried it in a dictionary and it didn\'t give an error.
CODE:
enumm = {0: 1, 1: 2, 2:
dict.keys()Keys and values are iterated over in an arbitrary order which is non-random, varies across Python implementations, and depends on the dictionary’s history of insertions and deletions. If keys, values and items views are iterated over with no intervening modifications to the dictionary, the order of items will directly correspond.
That's why you see the indices 0 to 7 in the first column. They are produced by enumerate and are always in the correct order. Further you see the dict's keys 0 to 7 in the second column. They are not sorted.