Create dict from two lists
py
codecraig at gmail.com
Fri Feb 10 09:42:59 EST 2006
More information about the Python-list mailing list
Fri Feb 10 09:42:59 EST 2006
- Previous message (by thread): Create dict from two lists
- Next message (by thread): Create dict from two lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Previous message (by thread): Create dict from two lists
- Next message (by thread): Create dict from two lists
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list