Table of Contents
show
- Anonymous functions are special functions which are not declared using standard def keyword
- lambda keyword is used to create small anonymous function
- Lambda function can take any number of arguments but can only have one expression
Syntax,
lambda arguments:expression
The expression is executed and the result is returned
Example,
x=lambda a,b: a+b
print(x(2,3))
Output,
5
Views: 0