subject

Given dictionaries, d1 and d2, create a new dictionary with the following property: for each entry (a, b) in d1, if a is not a key of d2 (i. e., not a in d2) then add (a, b) to the new dictionary for each entry (a, b) in d2, if a is not a key of d1 (i. e., not a in d1) then add (a, b) to the new dictionary For example, if d1 is {2:3, 8:19, 6:4, 5:12} and d2 is {2:5, 4:3, 3:9}, then the new dictionary should be {8:19, 6:4, 5:12, 4:3, 3:9} Associate the new dictionary with the variable d3

Done in Python please!

Here's what I have:

d3 = {}

for i, v in d1.items():

if v in d2.keys():
d3[i] = d2[v]

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
Which option correctly describes a dbms application? a. software used to manage databases b. software used to organize files and folders c. software used to develop specialized images d. software used to create effective presentations
Answers: 1
question
Computers and Technology, 23.06.2019 10:50
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
question
Computers and Technology, 23.06.2019 19:30
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Given dictionaries, d1 and d2, create a new dictionary with the following property: for each entry (...
Questions
question
Mathematics, 01.12.2020 21:50
question
Chemistry, 01.12.2020 21:50
question
Mathematics, 01.12.2020 21:50
question
Business, 01.12.2020 21:50
Questions on the website: 13722363