Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created February 3, 2018 02:20
Show Gist options
  • Save Fhernd/5c5fe254988485fe7b58f5b8593186f0 to your computer and use it in GitHub Desktop.
Save Fhernd/5c5fe254988485fe7b58f5b8593186f0 to your computer and use it in GitHub Desktop.
Generar funciones especializadas en Python.
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