Lambda statement in Python

The Python lambda statement is an anonymous or unbound function and a pretty limited function at that. Let’s take a look at a few typical examples and see if we can find a use case for it. The typical examples that one normally sees for teaching the lambda are some sort of boring doubling function. Just to be contrary, our simple example will show how to find the square root. First we’ll show a normal function and then the lambda equivalent:

Get hands-on with 1200+ tech skills courses.