[Python-de] dictonary umdrehen

Andreas Jung andreas at andreas-jung.com
Thu Feb 21 06:54:01 EST 2002


d = {}
for k,v in olddict.items():
   d[v]=k

Andreas
----- Original Message -----
From: "Felix Seeger" <seeger at sitewaerts.de>
To: <python-de at starship.python.net>
Sent: Thursday, February 21, 2002 06:46
Subject: [Python-de] dictonary umdrehen


> Hi ich habs mal gelesen, aber ich finds nicht mehr. Wie kann ich alle
werte
> in einem dict vertauschen.
> Also:
>
> key value
> --> zu
> value key
>
>
> thanks
> have fun
> HAL
> _______________________________________________
> Python-de maillist  -  Python-de at starship.python.net
> http://starship.python.net/mailman/listinfo/python-de
>




More information about the Python-de mailing list