Lambda is just an expression, and the function body is much simpler than def.
The body of a lambda is an expression, not a block of code. Only a finite amount of logic can be encapsulated in a lambda expression.
A lambda expression acts as a function sketch. Allows the definition of a function to be embedded within the code.
Here's an example:
Defines a lambda expression that evaluates to three numbers.
Let's look at an example:
Use a lambda expression to find the factorial of N.
------------------------------
Lambda expressions can also be used in Def functions.
See Example:
This defines an action function that returns a lambda expression. Where the lambda expression obtains the value of the variable name x for the upper def Scope.
A is the return value of the action function, a (22), which is the lambda expression called the action return.
It is also possible to write def directly into lambda form. As follows
Lambda usage in Python