Reference resources python Dictionaries (Dictionary) items() Method - cloud + Community - Tencent cloud
items function , Will a The dictionary is returned as a list , Because the dictionary is out of order , So the list returned is also unordered .
a = {'a':1,'b':3}
a.items()
return a = [('a',1),('b',3)]
iteritems() Returns an iterator .
b = a.iteritems()
list(b) =[('a',1),('b',3)]
for k,v in b:
print k,v
return a 1
b 3