Sorting a set works, sorting a dictionary fails ?

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Mon Jun 10 05:40:01 EDT 2013


Am 10.06.2013 10:29, schrieb Νικόλαος Κούρας:
> for key in sorted( months.values() ):
       ^^^                   ^^^^^^

> KeyError 1 ??!! All i did was to tell python to sort the dictionary values, which are just integers.

...and which you then proceed to use as key, which is obviously wrong.

Uli




More information about the Python-list mailing list