字典中items(),keys(),values()

list中values为数值,keys为前缀,items为整个

>>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' }  
>>> dict.values()  
['b', 2, 'world']  
>>> dict.keys()  
['a', 1, 'hello']  
>>> dict.items()  
[('a', 'b'), (1, 2), ('hello', 'world')]  

猜你喜欢

转载自blog.csdn.net/u014239185/article/details/78541447