Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 o

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+you think is being taxed when more money is printed? Why?

Answered: 1 week ago