Answers for "reverse acces a dictionary"

1

invert dictionary python

orig = { 1:'A',  2:'B',  3:'C' }
new = dict(zip(orig.values(), orig.keys()))
new == {'A': 1, 'B': 2, 'C': 3} #True
Posted by: Guest on January-19-2021

Code answers related to "reverse acces a dictionary"

Python Answers by Framework

Browse Popular Code Answers by Language