0
Can anyone please explain me the concept of functions as arguments in python?
3 Respostas
+ 1
You can use it as loop till a condition is True.
+ 1
It takes the function as argument to call it.
The function in argument can change when the program is running if you want to.
0
Hi Alex
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))
"""
I couldn't understand the second function(the portion that I marked)