devxlogo

September 19, 2019

Merge Two Dictionaries in Python

The Dictionary class in Python provide an update() function that allows you to merge two dictionaries. For example: employeeScore = { ‘Emp1’:100, ‘Emp2’:98, ‘Emp3’:96}employee2019Score= { ‘Emp1’:101, ‘Emp2’:104} To merge, just