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

Python 字典(Dictionary) update()方法


描述

Python 字典(Dictionary) update() 函數(shù)把字典dict2的鍵/值對更新到dict里。

語法

update()方法語法:

dict.update(dict2)

參數(shù)

  • dict2 -- 添加到指定字典dict里的字典。

返回值

該方法沒有任何返回值。

實(shí)例

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

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7}
dict2 = {'Sex': 'female' }

dict.update(dict2)
print "Value : %s" %  dict

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

Value : {'Age': 7, 'Name': 'Zara', 'Sex': 'female'}
其他擴(kuò)展