Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from functools import partial
- def sumar(a, b, c, d):
- return a + b + c + d
- # Producen error:
- # sumar(2, 3, 4)
- # sumar(7, 11)
- # Uso de la función `partial`:
- sumar1 = partial(sumar, 1)
- sumar2 = partial(sumar, 3, 5)
- print(sumar1(2, 3, 4))
- print(sumar2(7, 11))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement