6/2/2020 3:32:09 PM
You can use it as loop till a condition is True.
It takes the function as argument to call it.
The function in argument can change when the program is running if you want to.
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)
Learn Playing. Play Learning
Send us a message