Created
November 12, 2013 10:50
-
-
Save bayadeoro/7429022 to your computer and use it in GitHub Desktop.
Con esto obtenemos la key del diccionario sabiendo el valor.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mydict = {'george':16,'amber':19} | |
| print mydict.keys()[mydict.values().index(16)] | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fuente original:
Respuesta 31 a la pregunta del foro:
http://stackoverflow.com/questions/8023306/get-key-by-value-in-dictionary