Question: python 2. (5 points) Write a function that takes two dictionaries and add the key:value pairs from the second dictionary to the first. If a

python python 2. (5 points) Write a function that takes two dictionaries and

2. (5 points) Write a function that takes two dictionaries and add the key:value pairs from the second dictionary to the first. If a key already exists in the first dictionary, ignore it. Test your function with the following program. my_dict1 - {1: 12, 2: 14, 5: 13} my_dict2 = {1: 13, 4: 3, 10: 20) print (my_dict1) print(my_dict2) add_dict (my_dict1, my_dict2) print(my_dict1) You should get the following output {1: 12, 2: 14, 5: 13) {1: 13, 4: 3, 10: 20} {1: 12, 2: 14, 5: 13, 4:3, 10: 20} Process finished with exit code 0

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!