Python

Constant dripping wears away a stone

Lambda Functions


Lambda Functions: A lambda function is an anonymous function in Python. The syntax is lambda parameter(s): an expression. A lambda function may contain multiple parameters, but can have only one expression. A lambda function can be considered as a shorthand notation because it is not needed to formally define the function usingdef.

  • Name: A lambda function can be assigned a name because it is an expression.
  • Arguments: A lambda function can be put in parentheses followed by the function arguments enclosed in parentheses. If the function has multiple parameters, the same number of arguments are separated with commas.