Python Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 77)
77.
How can you define a lambda function that adds two numbers?
lambda x, y: x + y
def add(x, y): return x + y
lambda add(x, y): x + y
lambda add: x + y
Answer: Option
Explanation:
The correct syntax for a lambda function that adds two numbers is lambda x, y: x + y.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.