python学习之dict的items(),values(),keys()

Python的字典的items(), keys(), values()都返回一个list

1     >>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' }  
2     >>> dict.values()  
3     ['b', 2, 'world']  
4     >>> dict.keys()  
5     ['a', 1, 'hello']  
6     >>> dict.items()  
7     [('a', 'b'), (1, 2), ('hello', 'world')]  
8     >>>   
原文地址:https://www.cnblogs.com/zmlctt/p/4226504.html