Home >>Python Keywords >Python lambda Keyword

Python lambda Keyword

Python lambda Keyword

Python lambda keyword can take any number of arguments and is used to create small anonyms functions, but they can return only one value in the form of expressions.

Here is an example of Python lambda Keyword:

z = lambda x : x + 30
print(z(5))

Output:
35
Example 2:

e = lambda x, y, z : x + y + z
print(e(15, 5, 12))

Output:
32

No Sidebar ads