中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Python 字典(Dictionary) items()方法


描述

Python 字典(Dictionary) items() 函數(shù)以列表返回可遍歷的(鍵, 值) 元組數(shù)組。

語(yǔ)法

items()方法語(yǔ)法:

dict.items()

參數(shù)

  • NA。

返回值

返回可遍歷的(鍵, 值) 元組數(shù)組。

實(shí)例

以下實(shí)例展示了 items()函數(shù)的使用方法:

實(shí)例(Python 2.0+)

#!/usr/bin/python # coding=utf-8 dict = {'Google': 'www.google.com', 'Runoob': '', 'taobao': 'www.taobao.com'} print "字典值 : %s" % dict.items() # 遍歷字典列表 for key,values in dict.items(): print key,values

以上實(shí)例輸出結(jié)果為:

字典值 : [('Google', 'www.google.com'), ('taobao', 'www.taobao.com'), ('Runoob', '')]
Google www.google.com
taobao www.taobao.com
Runoob 
其他擴(kuò)展