Google News
logo
Python Program to A lambda function that sums argument a, b, and c
In the following example of Python program to create a lambda function that sums three arguments a, b, and c :
Program :
f = lambda a,b,c : a + b + c
print(f(1,2,3)) # Output: 6
Output :
6
In this program, we have defined a lambda function `f` that takes three arguments `a`, `b`, and `c`.

The function body adds the three arguments and returns the sum.

We have then called the lambda function with arguments `1`, `2`, and `3` and printed the output. The output will be `6`, which is the sum of the three arguments.