Question: Exercise 3 [Merging Dictionaries] Write a function called merge1(d1,d2) that takes two dictionaries as input parameters. This function will create and return a new dictionary

 Exercise 3 [Merging Dictionaries] Write a function called merge1(d1,d2) that takes

Exercise 3 [Merging Dictionaries] Write a function called merge1(d1,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. For this problem you can assume that the input dictionaries do not have any keys in common. Create a few dictionaries, print them to screen using the function created above. After this, merge them using the function you wrote and print the result to screen. Do NOT use any built-in methods that do this for you. For example, >>> di = {'A': 100, 'C':300) >>> d2 = ('B': 200, 'D':400) >>> d3 = mergel (di, d2) >>> display (3) A-> 100 B -> 200 D -> 400 C -> 300

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!