AW: [Python-de] Dictionary aus zwei Listen erstellen
dict (map (None, keys, values)) ciao, Rainer -----Ursprüngliche Nachricht----- Von: python-de-bounces@python.net [mailto:python-de-bounces@python.net] Im Auftrag von "Sebastian \"Marduk\" Pölsterl" Gesendet: Donnerstag, 4. August 2005 13:31 An: python-de@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----- _______________________________________________ python-de maillist - python-de@python.net http://python.net/mailman/listinfo/python-de
participants (2)
-
Rainer Fischbach
-
tanzer@swing.co.at