Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write Python program for the following question 2. (5 points) Write a function that takes two dictionaries and add the key:value pairs from the second
Write Python program for the following question
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_dicti,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 oStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started