pozz <[email protected]> writes: > I have a dictionary where the keys are numbers: ...
Python 2.7.5:
>>> mydict = { 1: 1000, 2: 1500, 3: 100 }
>>> keydict = { 1: "apples", 2: "nuts", 3: "tables" }
>>> newdict = dict((keydict[k],v) for k,v in mydict.items())
>>> print newdict
{'tables': 100, 'nuts': 1500, 'apples': 1000}
--
https://mail.python.org/mailman/listinfo/python-list
