AW: [Python-de] Dictionary aus zwei Listen erstellen
Rainer Fischbach
fischbach at ecs-gmbh.de
Fre Aug 12 12:06:08 CEST 2005
dict (map (None, keys, values))
ciao, Rainer
-----Ursprüngliche Nachricht-----
Von: python-de-bounces at python.net [mailto:python-de-bounces at python.net] Im Auftrag von "Sebastian \"Marduk\" Pölsterl"
Gesendet: Donnerstag, 4. August 2005 13:31
An: python-de at python.net
Betreff: [Python-de] Dictionary aus zwei Listen erstellen
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hallo!
Ich habe eine Liste, die die keys des dictionary enthält und eine
weitere, die die dazugehörigen Werte enthält. Wie kann ich jetzt am
Besten beide zu einem dictionary verschmelzen?
Bsp.:
keys = ['key1','key2','key3']
values = ['wert1','wert2','wer3']
dic = {'key1': 'wert1', 'key2': 'wert2', 'key3': 'wert3'}
- --
Gruß,
Sebastian Pölsterl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFC8fyC1ygZeJ3lLIcRAgg5AJ0eHTr7IsOAJmMYhue6dyUJ+SDTyACfaWKS
rnTKBprBcqyD1aH04FbwQfM=
=y4O8
-----END PGP SIGNATURE-----