How to Use Lambda Function Inside Another Function in Python


In this example we will show how to use the lambda function as an anonymous function inside another function in Python.

Source Code

def my_func(z):
    return lambda x, y: x + y * z


my_func_1 = my_func(5)
print(my_func_1(2, 3))

Output:

17
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments