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

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

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!