0
Can someone explain this function within functiong thing
def add(x, y): return x + y def do_twice(func, x, y): return func(func(x, y), func(x, y)) a = 5 b = 10 print(do_twice(add, a, b))
2 Respuestas
+ 1
By making func add what it's now reading is:
Return add(a+b,a+b)
Everywhere you use the word func, has become add.
- 1
u r calling the function pointer with given parameters, first the most inner calls are made, then u get to make the last outter call.