this way, we can use functions even inside a function.
The main difference between recursion & this is that:
- in recursion, we are using the same function inside a function.
- in this, we are using another function.
def appl(fx, value):
return 6 + fx(value)
double = lambda x: x * 2
cube = lambda x: x * x * x
avg = lambda x, y, z: (x + y + z) / 3 # function to calculate average.
print(appl(double , 2))
# Output:
10