Python: Lambda Function

Python Lambda function is also called-

  • Lambda expression
  • Anonymous function
  • Function literal
  • Lambda abstraction

Defining Lambda Function

Here is what we need to define a Lambda function/expression-

Start with the keyword “lambda“.
Then put the list of parameters, which are separated by commas.
Put colon(:) after that.
Finally, write the return value or expression. Only one expression can be here, which is returned.

lambda list_of_params: return_value_or_expression

Leave a Comment


The reCAPTCHA verification period has expired. Please reload the page.