[Python-de] Dictionary aus zwei Listen erstellen
Harald Armin Massa
haraldarminmassa at gmail.com
Don Aug 4 14:00:24 CEST 2005
mydict=dict(zip(liste1, liste2))
2005/8/4, "Sebastian \"Marduk\" Pölsterl" <marduk at k-d-w.org>:
>
> -----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 at python.net
> http://python.net/mailman/listinfo/python-de
>
>
>
--
GHUM Harald Massa
persuasion python postgresql
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://starship.python.net/pipermail/python-de/attachments/20050804/46e093a5/attachment.htm