我对以下输出结果感到有些困惑,我不理解执行的循环顺序。
domains = { "de": "Germany", "sk": "Slovakia", "hu": "Hungary",
"us": "United States", "no": "Norway" }
for key in domains:
print key
这里的输出是
sk
de
no
us
hu
但不是
de
sk
hu
us
no
同样地,在这里
num = {1:"one",4:"two",23:"three",10:"four"}
for key in num:
print key
output is
1
10
4
23
但不
1
4
23
10
感谢您的帮助