Computer Science, asked by AnanyG, 4 months ago

Given the dictionary x={‘k1’:’v1’, ‘k2’:’v2’, ‘k3’: ‘v3’, ‘k4’: ‘v4’}

Create a dictionary of opposite mapping, like x={’v1’ : ’k1’, ‘v2’ : ’k2’, ’v3’ : ’k3’,’v4’: ‘k4’}​

Answers

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

x = {"k1":"v1", "k2":"v2", "k3": "v3", "k4": "v4"}

y = {v: k for k, v in x.items()}

print(y)

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
0

Answer:

x = {"k1":"v1", "k2":"v2", "k3": "v3", "k4": "v4"}

y = {v: k for k, v in x.items()}

print(y)

Similar questions