Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bayadeoro/7429022 to your computer and use it in GitHub Desktop.

Select an option

Save bayadeoro/7429022 to your computer and use it in GitHub Desktop.
Con esto obtenemos la key del diccionario sabiendo el valor.
mydict = {'george':16,'amber':19}
print mydict.keys()[mydict.values().index(16)]
@bayadeoro
Copy link
Author

Fuente original:
Respuesta 31 a la pregunta del foro:
http://stackoverflow.com/questions/8023306/get-key-by-value-in-dictionary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment