Python学习笔记一

来源:互联网 发布:淘宝拍a发b平台赚钱 编辑:程序博客网 时间:2024/04/30 14:24

一、字典的使用

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

[python] view plaincopy
  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. >>>   


0 0