In php, one can handle a list of state names and their abbreviations with an associative array like this:
Along the lines of Alexander's answer...
The native python dictionary doesn't maintain ordering for maximum efficiency of its primary use: an unordered mapping of keys to values.
I can think of two workarounds:
look at the source code of OrderedDict and include it in your own program.
make a list that holds the keys in order:
states = ['Alabamba', 'Alaska', ...]
statesd = {'Alabamba':'AL', 'Alaska':'AK', ...}
for k in states:
print "The abbreviation for %s is %s." % (k, statesd[k])