Question: 5. Create a function which concatenates two dictionaries. If the two dictio- naries have the same key then their values should be added. Perform the

 5. Create a function which concatenates two dictionaries. If the two

5. Create a function which concatenates two dictionaries. If the two dictio- naries have the same key then their values should be added. Perform the following test cases: 1) if the two dictionaries are {"a": 1, "b": 2} and {"d": 4} then the func- tion should return {'a': 1, 'b': 2, 'd': 4} 2) if the two dictionaries are {"a": 1, "b": 2} and {"a":3, "d": 4} then the function should return {'a': 4, 'b': 2, 'd': 4} [1%]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!