July 28, 2010

Python's lambda

Because I don't quite get what and when python's lambda function's can be of any use - I did some research. Then I've found this sleek way of calling one lined function with unnamed parameter :
>>> (lambda x: x*2)(3)
6
Pretty cool.

No comments:

Post a Comment