Answer:
Check the explanation
Step-by-step explanation:
# python code
import sys
import readline
from sys import stdin
import random
d1 = {2:3, 8:19, 6:4, 5:12}
d2 = {2:5, 4:3, 3:9}
d3 = {}
#for each entry (a, b) in d1
for i,v in d1.items():
# if a is not a key of d2
if i not in d2.keys():
# add (a,b) to the new dictionary
d3[i] = v
# for each entry (a, b) in d2
for i,v in d2.items():
# if a is not a key of d1
if i not in d1.keys():
#add (a,b) to the new dictionary
d3[i] = v
print "d3: ", d3
#output: d3: {8: 19, 3: 9, 4: 3, 5: 12, 6: 4}
Kindly check the Screenshot below.