In Python, lambda functions are anonymous functions (meaning functions without a name).

The syntax for lambda functions is lambda arguments: expression.

half = lambda x: x / 2
## 7.0
split = lambda s: list(s)
## ['h', 'i']
pow = lambda x, y: x ** y
pow(2, 3)
## 8

Lambda functions come in handy when you want to create a function that you won’t reuse. You can avoid defining the function and use a lambda function instead.