Lambda functions are basically one-line or anonymous functions. Lambda functions can take any number of arguments and can have only one expression. Lambda function doesn't return any value, it will return only expression.
Syntax: lambda arguments: expression
Program 1: Adding two numbers
output = lambda a, b : a + b
print(output(5,5))
Output:
10
Program 2: If-else
output = lambda a : print("Even Number") if a%2==0 else print("Odd Number")
print(output(5))
Output:
Odd Number