Worthwhile to reverse a dictionary

rudysanford at hotmail.com rudysanford at hotmail.com
Wed Dec 14 19:59:05 CET 2005


What is the difference between

 " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} "

and

" d1 = dict(A = 1, B = 2, C = 3) "  ?

All of the dictionary examples I saw (python.org, aspn.activestate.com,
Learning Python by Lutz, among others) use d={'x' : 'y'}.




More information about the Python-list mailing list