-In Python, anonymous function means that a function is without a name. As we already know that def keyword is used to define the normal functions and the lambda keyword is used to create anonymous functions.
Syntax-
lambda argument:expression
- it return the expression part.
program-
#add two number by lambda number
print("Addition of number by lambda ")
add=lambda x,y:x+y
print(add(3,4))
print(add(1,-1))
print(add(3,0))
#find cube of number
print("Cube lambda function")
cube=lambda x:x**3
print(cube(3))
print(cube(5))
print(cube(10))
Addition of number by lambda
7
0
3
Cube lambda function
27
125
1000