Created
June 14, 2015 18:23
-
-
Save oca159/4ff2069daffcf278a2d7 to your computer and use it in GitHub Desktop.
Simular switch en python
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
def f(x): | |
return { | |
'a': 1, | |
'b': 2, | |
}.get(x, "No se encontró esa opción") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment