Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
switching keys and values in a dictionary in python [duplicate]
Lou
Programming language:
Python
2021-06-16 13:25:49
0
Q:
switching keys and values in a dictionary in python [duplicate]
user9701
Code:
Python
2021-02-05 09:48:57
my_dict = {2:3, 5:6, 8:9} new_dict = {} for k, v in my_dict.items(): new_dict[v] = k
1
Tags
key
python
value
values
dict
Related
how to have multiple values to a key in dict in python
python create dictionary from key value
delete a key value pair from a dictionary in python
how many keys in a dictionary python
remove multiple keys from dictionary python
python dictionary add key-value pair
python dict exclude keys
python added dictionary together
python list keys from dictionary
python remove key from dict
how to set a key of dict in python
remove keys from dict python
for key value in dict python
python sort dict by key
New to Communities?
Join the community