从0开始学python:字典dictionary
2013-08-09 10:47
197 查看
Python的字典的items(), keys(), values()都返回一个list
[python] view
plaincopy
>>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' }
>>> dict.values()
['b', 2, 'world']
>>> dict.keys()
['a', 1, 'hello']
>>> dict.items()
[('a', 'b'), (1, 2), ('hello', 'world')]
>>>
[python] view
plaincopy
>>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' }
>>> dict.values()
['b', 2, 'world']
>>> dict.keys()
['a', 1, 'hello']
>>> dict.items()
[('a', 'b'), (1, 2), ('hello', 'world')]
>>>
相关文章推荐
- Python 字典(Dictionary)
- Python 字典(Dictionary) keys()方法
- Python 字典(Dictionary)
- Python基础-dictionary 字典
- 【python】Python 字典(Dictionary)操作详解
- Python 3语法小记(四)字典 dictionary
- Python 3语法小记(四)字典 dictionary
- Python 字典(Dictionary)
- python 字典(Dictionary)
- Python 字典(Dictionary)
- Python 字典(Dictionary)
- Python 字典(Dictionary)
- Python学习练习3----Dictionary(字典)
- Python 字典(Dictionary) has_key()方法
- Python 字典(Dictionary)day11
- [Python]字典Dictionary、列表List、元组Tuple差异化理解
- Python 字典(Dictionary)数据处理
- Python字典dictionary
- Python 字典(Dictionary) values()方与 keys()方法
- Python 字典(Dictionary) setdefault()方法