Copyright © tutorialspoint.com
This class method adds dictionary dict2's key-values pairs in to dict. This function does not return anything.
dict.update(dict2) |
Here is the detail of parameters:
dict2: This is the dictionary to be added into dict.
#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7} dict2 = {'Sex': 'female' } dict.update(dict2) print "Value : %s" % dict |
This produces following result:
Value : {'Age': 7, 'Name': 'Zara', 'Sex': 'female'} |
Copyright © tutorialspoint.com