Answers for "reverse key list value dictionary python"

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 key list value dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language