Python Dictionary update() Method

0

Python Dictionary update() Method

  • The update() method updates the dictionary with the elements from the another dictionary object or from an iterable of key/value pairs. 

  • The update() method adds element(s) to the dictionary if the key is not in the dictionary. If the key is in the dictionary, it updates the key with the new value.

Syntax

  • dictionary.update(iterable)

Parameter Values

  • iterable - A dictionary or an iterable object with key value pairs, that will be inserted to the dictionary.

 

 

Post a Comment

0Comments
Post a Comment (0)