Question: I want to know what exactly is `lambda` in python? and where and why it is used.
thanks

Answer: 
Lambdas are not anonymous functions. Lambdas are anonymous *expressions*.

They're accessed like functions, but they're not the same thing. Functions allow complex tasks: flow control, variable declarations and lists of statements containing expressions. Expressions are merely one part of a function, and that's what lambdas give you. They're severely limited compared to functions.

Python does not support anonymous functions. For examples of languages that do, see Javascript and Lua.

(Note: It's correct to call lambdas anonymous functions in functional languages, where the mathematical definition of "function" is used, but in procedural languages the word has a very different meaning than in mathematics.)
The first linked returned by googling "python lambda" points to a [page](http://www.secnetix.de/olli/Python/lambda_functions.hawk) whose first paragraphs answer your question. I could copy & paste the content it, but I think it's unfair :)