标签:
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 >>>
python学习之dict的items(),values(),keys()
标签:
原文地址:http://www.cnblogs.com/zmlctt/p/4226504.html