Sorting dict keys

Roberto Bonvallet rbonvall at gmail.com
Sat Jul 21 01:30:50 CEST 2007


On 20 jul, 18:50, Alex Popescu <nospam.themindst... at gmail.com> wrote:
> If you just want to iterate over your dict in an ordered manner than all
> you have to do is:
>
> for k in my_dict.keys().sort():
>   # rest of the code

sort() returns None, so this code won't work either.

--
Roberto Bonvallet




More information about the Python-list mailing list