Dictionary Questions
Dictionary Questions
6. Given the dictionary x={'K1':'V1' ,'K2' :'V2' ,'K3' : 'V3'} , create a dictionary
with the opposite mapping i.e., write a program to create the dictionary
as : inverted_x (x1= {'V1': 'K1', 'V2': 'K2', 'V3': 'K3'})
x1={}
for a in x:
b=x[a]
x1[b]=a
print(x1)