Python 字典(Dictionary) items()方法
来源:互联网 发布:java连接mongodb 编辑:程序博客网 时间:2024/05/17 08:23
描述
Python 字典(Dictionary) items() 函数以列表返回可遍历的(键, 值) 元组数组。
语法
items()方法语法:
dict.items()
参数
- NA。
返回值
返回可遍历的(键, 值) 元组数组。
实例
以下实例展示了 items()函数的使用方法:
实例(Python 2.0+)
#!/usr/bin/python# coding=utf-8dict = {'Google':'www.google.com','Runoob':'www.runoob.com','taobao':'www.taobao.com'}print"字典值 : %s" % dict.items()# 遍历字典列表forkey,valuesindict.items():printkey,values
以上实例输出结果为:
字典值 : [('Google', 'www.google.com'), ('taobao', 'www.taobao.com'), ('Runoob', 'www.runoob.com')]Google www.google.comtaobao www.taobao.comRunoob www.runoob.com
阅读全文
0 0
- Python 字典(Dictionary) items()方法
- 1006- Python 字典(Dictionary) items()方法
- Python 字典(Dictionary) setdefault()方法
- Python 字典(Dictionary) has_key()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) get()方法
- Python 字典(Dictionary) setdefault()方法
- Python dictionary items() Method
- Python中字典的items()方法
- Python中的字典方法:items(),get(),keys()
- python 字典 get(),items(),iteritems()方法
- 字典的items方法
- Python dictionary 字典
- python Dictionary字典使用
- Python字典 (dictionary)
- Python 字典(Dictionary)
- 2017云栖大会·杭州峰会:《在线用户行为分析:基于流式计算的数据处理及应用》之《数据可视化:构建实时动态运营数据分析大屏》篇
- 2.1.1方法内的变量(私有变量)是线程安全的
- Python3 I/O(数据流 模块)
- 接口测试的常用策略以及方法
- Mysql 查询数据并按顺序添加序号
- Python 字典(Dictionary) items()方法
- React、Vue实现购物车小球抛物线效果
- 2017.10.9离线赛总结
- 游戏设计模式--命令模式
- python小知识点
- Uncaught ReferenceError: Invalid left-hand side in assignment
- 2017云栖大会·杭州峰会:《在线用户行为分析:基于流式计算的数据处理及应用》之《流数据处理:通过StreamSQL分析视频日志》篇
- Codeforces 214C Game【思维+拓扑排序】
- 计蒜客 ACM ICPC 2017 Warmup Contest 1 G Game Rank