YouTip LogoYouTip

Python3 Att Dictionary Update

# Python3.x Python3 Dictionary update() Method [![Image 3: Python3 Dictionary](#) Python3 Dictionary](#) * * * ## Description The Python dictionary update() function updates the dictionary `dict` with the **key/value (key/value)** pairs from dictionary `dict2`. ## Syntax The syntax for the update() method is: dict.update(dict2) ## Parameters * dict2 -- A dictionary to be added to the specified dictionary `dict`. ## Return Value This method does not return any value. ## Example The following example demonstrates the usage of the update() function: ## Example (Python 2.0+) #!/usr/bin/python3 tinydict = {'Name': '', 'Age': 7} tinydict2 = {'Sex': 'female' } tinydict.update(tinydict2)print("Updated dictionary tinydict : ", tinydict) The output of the above example is: Updated dictionary tinydict : {'Name': '', 'Age': 7, 'Sex': 'female'} * * Python3 Dictionary](#)
← Java Arraylist RemoverangeJava Arraylist Containsall β†’