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

上一篇 / 下一篇  2017-09-15 17:53:58 / 个人分类:python

http://blog.csdn.net/xxkkff/article/details/4368541

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

[python] view plain copy
  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'), (12), ('hello''world')]  
  8. >>>   


TAG:

 

评分:0

我来说两句

日历

« 2024-04-29  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 45656
  • 日志数: 54
  • 建立时间: 2017-04-28
  • 更新时间: 2018-01-25

RSS订阅

Open Toolbar