[Tutor] How to print corresponding keys in Dictionary

Praveen Singh c2praveen30jun at gmail.com
Mon Oct 24 15:10:03 CEST 2011


In Dictionary-
How to print corresponding keys if the values of dictionary is given??

-d={'a':1,'b':2,'c':3}
-i can print the corresponding values by using get() method-
- d.get('a')
-1

What if i have to print reverse???
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20111024/4e93b943/attachment.html>


More information about the Tutor mailing list