Worthwhile to reverse a dictionary

rudysanford at hotmail.com rudysanford at hotmail.com
Wed Dec 14 12:50:11 EST 2005


I just started messing with programming and started with Python.  Part
of my first project deals with translating numerical values to letters.
I would like to be able to do the reverse as well, letters to numbers,
sort of a table for lookup and a table for reverse lookup.  I thought
that a dictionary would be the structure to use- write it once and in a
second instance swap the keys for values and values for keys.  However,
reversing a dictionary does not seem to be easily achieved.  Am I using
the wrong data structure?




More information about the Python-list mailing list