Created
February 3, 2018 02:20
-
-
Save Fhernd/5c5fe254988485fe7b58f5b8593186f0 to your computer and use it in GitHub Desktop.
Generar funciones especializadas en Python.
This file contains 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 generar_escala(numero): | |
return lambda multiplicador: multiplicador * numero | |
multiplicar_por_2 = generar_escala(2) | |
print(multiplicar_por_2(5)) | |
multiplicar_por_3 = generar_escala(3) | |
print(multiplicar_por_3(5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment