Python lambda Keyword

Used to create an anonymous (lambda) function

Syntax

Python
lambda arguments: expression

A lambda function is a (usually small) function that is defined without a name. A lambda function is declared as an expression and then either assigned to a variable or passed as a parameter to another function.

Example

Python
my_function = lambda x : x.capitalize()

For a deeper discussion see Lambda Functions.