Merging two lists as a dictionary
Alex
alex at somewhere.round.here
Wed Jul 21 10:37:43 EDT 1999
More information about the Python-list mailing list
Wed Jul 21 10:37:43 EDT 1999
- Previous message (by thread): Merging two lists as a dictionary
- Next message (by thread): Merging two lists as a dictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Would
import operator
destination={}
assert len(list_of_keys)==len(list_of_values)
map(operator.setitem,len(list_of_keys)*[destination],list_of_keys,
list_of_values)
do the trick?
Maybe the "for" loop way is faster, though.
Alex.
- Previous message (by thread): Merging two lists as a dictionary
- Next message (by thread): Merging two lists as a dictionary
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list