This post is about Lambda which remain one of the most confusing topic for beginners. After reading couple of articles, here I’m sharing gist of them.
Lambda is used to create function like def() but it returns the function instead of assigning name to it. This is the reason it is also called anonymous function.
Lambda function enable to add functionality where we don’t need to call function more than once.
For more understanding, have a look at the difference of lambda from function.
Taking another example of for loop with and without Lambda,
With Lambda, we can achieve the same result in one line.
Few more examples here: http://p-nand-q.com/python/lambda.html