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

Answer: 
`lambda` is a way of defining an anonymous in-line function to accomplish some task versus defining it with the `def` keyword and calling it. Think of it as a shorthand you can use when you won't need to reuse a function. Anywhere you use lambda, you could substitute an explicitly called function: it's use is completely optional and left to the programmer as a matter of coding style.

Example code (without lambda):

```
def numSquared(num):
    return num**2

for i in range(1,11):
    print numSquared(i)

```

Example code (with lambda):

```
for i in range(1,11):
    print (lambda x: x**2)(i)

```

A good beginner's discussion of `lambda`:
[DiveIntPython.org - Lambda](http://diveintopython.net/power_of_introspection/lambda_functions.html "DiveIntoPython - Lambda")
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 :)