In this article we will learn about the python update function in the python dictionary. What does the update function mean in the python dictionary? , the function of this function will be answered in the following article.
python update function description
Python dictionary (Dictionary) update() function updates the key/value pairs of dictionary dict2 into dict.
Syntax
dict.update(dict2)
Parameters
Return value
This method does not have any return value. Python update function exampleThe following example shows how to use the update() function:#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7} dict2 = {'Sex': 'female' } dict.update(dict2) print "Value : %s" % dict
Value : {'Age': 7, 'Name': 'Zara', 'Sex': 'female'}
Python tutorial column on the php Chinese website.
The above is the detailed content of Python update function definition and action example analysis. For more information, please follow other related articles on the PHP Chinese website!