Python: update() method of dictionary
2 min readApr 16
--
In Python, you can use the update()
method to update a dictionary with key-value pairs from another dictionary or an iterable of key-value pairs. The syntax for using the update()
method is as follows:
my_dict.update(other_dict)
or
my_dict.update(iterable)