Create dict from two lists

py codecraig at gmail.com
Fri Feb 10 09:42:59 EST 2006


Iain King wrote:
> Short answer - you can't.  Dictionaries aren't sequential structures,
> so they have no sorted form.  You can iterate through it in a sorted
> manner however, as long as you keep your list of keys:
>
> keys.sort()
> for k in keys:
>     print d[k]
> 
> Iain

duh!....thanks.




More information about the Python-list mailing list