I\'m curious about the difference between lambda function and a regular function (defined with def) - in the python level. (I know what is the diff
lambda create anonymous function. This idea has been taken from functional programming languages. In this way you can create and pass the function to other functions like map and filter. ( look here )
You can pass normal functions to these functions too, but since mostly their simple and they have used nowhere else, it's inconvenient to through to whole process of definfing a new function.
As an example take a look at this :
>>> a = [1, 2, 3, 4]
>>> print map( lambda x : x*2 + 1, a )
[3, 5, 7, 9, 11]