Python的字典的items(), keys(), values()

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 >>> 

 

posted @ 2015-07-12 18:10  土豆土豆好  阅读(162)  评论(0)    收藏  举报