Question: python programming Exercise 4 [Merging Dictionaries Again] Write a function called merge2(d2,d2) that takes two dictionaries as input parameters. This function will create and return
![python programming Exercise 4 [Merging Dictionaries Again] Write a function called](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4de8957407_78466f4de88ce53d.jpg)
python programming
Exercise 4 [Merging Dictionaries Again] Write a function called merge2(d2,d2) that takes two dictionaries as input parameters. This function will create and return a new dictionary that contains everything from the two input dictionaries and return it. The same key might appear in both input dictionaries. In the output dictionary, the value for each key will be a list that has all values corresponding to this key in the two input dictionaries. The order of the items in the values is not important. For example, >>> di = {'a': 100, 'b': 200, 'c':300) >>> d2 = {'a': 300, 'b': 200, 'd' :400) >>> d3 = merge2 (di, d2) >>> display (3) a -> (100,300] b => [200, 200) c-> (300) d-> (400)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
