所以刚刚开始使用Python创建字典(如果有帮助的话,可以使用Spyder)...基本上制作了一个名为t的字典,但是值没有按照我分配的顺序存储
t={'first':'a','second':'b','third':'c'}
print t
for i in t :
print t[i]
t中的值被存储为{'second':'b','third':'c','first':'a'}}并以此进行分配?这是怎么回事?
t={'first':'a','second':'b','third':'c'}
print( t)
for i in t :
print (t[i])
输出:
{'first': 'a', 'second': 'b', 'third': 'c'}
a
b
c
您使用有序还是无序词典?