I was trying to learn about using dictionaries in python and made two very short programs. I have a doubt over the output of the program. Here is the code.
d = {}
d[0] = '0'
d[1] = '1'
d[2] = '2'
for keys in d:
print d[keys]
and it gave the following output
0
1
2
but, when I made the following program.
d = {}
d['name'] = "Pratik"
d['age'] = 17
d['country'] = "India"
for keys in d:
print d[keys]
it gave the following output
India
17
Pratik
It would be great if somebody could explain this output to me. The expected output looking at the first output was
Pratik
17
India