0

Can anyone please explain me the concept of functions as arguments in python?

2nd Jun 2020, 3:32 PM
Sundharesan M
Sundharesan M - avatar
3 Respostas
+ 1
You can use it as loop till a condition is True.
2nd Jun 2020, 3:36 PM
Alex
Alex - avatar
+ 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.
2nd Jun 2020, 3:43 PM
Alex
Alex - avatar
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)
2nd Jun 2020, 3:40 PM
Sundharesan M
Sundharesan M - avatar