Может кто-нибудь объяснить, как упорядочены словари python (v3.5)?
data = {"John": 23, "Rick": 33, "Mary": 63, "Ron": 23, "Joel": 51}
for key in data:
print("Your name is " + key + ", and you are also " + str(data[key]) + " years old.")
Фактический результат:
Your name is Rick, and you are also 33 years old.
Your name is Ron, and you are also 23 years old.
Your name is Mary, and you are also 63 years old.
Your name is John, and you are also 23 years old.
Your name is Joel, and you are also 51 years old.
Ожидаемый результат (порядок словаря) :
Your name is John, and you are also 23 years old.
Your name is Rick, and you are also 33 years old.
Your name is Mary, and you are also 63 years old.
Your name is Ron, and you are also 23 years old.
Your name is Joel, and you are also 51 years old.