Merging and Updating Dictionaries With Operators
00:42 As the name suggests, the merge operator merges the two dictionaries into a new one that contains the items of both initial dictionaries. If the dictionaries in the expression have common keys, then the rightmost dictionary’s value will prevail.
01:21 Here, you use the dictionary update operator to update Newton’s lifetime information. The operator updates the dictionary in place. If the dictionary with the updated data has new keys, then those keys are added to the end of the original dictionary.
Become a Member to join the conversation.