Last active
June 17, 2021 20:30
-
-
Save matthewpoer/998b2d54e96ef04b7d6804204d1ada41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> dictionary = {"one":"one value", "two":"two value"} | |
>>> new_dictionary = {"foo":"foo value", "bar":"bar value"} | |
>>> dictionary.update(new_dictionary) | |
>>> print(dictionary) | |
{'one': 'one value', 'two': 'two value', 'foo': 'foo value', 'bar': 'bar value'} | |
>>> dictionary = {"one":"one value", "two":"two value"} | |
>>> new_dictionary = {"foo":"foo value", "bar":"bar value"} | |
>>> dictionary.update({**new_dictionary}) | |
>>> print(dictionary) | |
{'one': 'one value', 'two': 'two value', 'foo': 'foo value', 'bar': 'bar value'} | |
>>> dictionary = {"one":"one value", "two":"two value"} | |
>>> new_dictionary = {"foo":"foo value", "bar":"bar value", "two":"updated two value"} | |
>>> dictionary.update(new_dictionary) | |
>>> print(dictionary) | |
{'one': 'one value', 'two': 'updated two value', 'foo': 'foo value', 'bar': 'bar value'} |
Author
matthewpoer
commented
Jun 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment