I hope the code explains my question better:
dic={'one':'root', 'two':'leaf', 'three':'tree', 'four':'fruit'}
for n in dic.keys():
n = dic.get(n)
print(n)
Output:
fruit
leaf
root
tree
Can anyone explain please, what is the logic behind this kind of sequence in output? I know, Dict does not support indexing. Then how does it work? why 'fruit' is at first and 'leaf' second?