+ 2
How to write a applytwice function that apply twice for another function with two arguments?
For example, the second function I want is def xpowery(x, y): return x**y
3 ответов
+ 7
ok, here is a base sample:
def apply_twice(func, arg, arg1):
return func(func(arg, arg1),arg1)
def mult(x,y):
return x * y
print(apply_twice(mult, 4, 7))
+ 5
See sololearn python course with functional programming:
https://www.sololearn.com/learn/Python/2459/
+ 2
This was the lesson that I got stuck with this problem. The add_five function only has one argument and works with apply_twice which has one function and one argument ( func, argu).
I need help on how to write apply_twice for a function with two arguments.