Scripting >> Python >> Examples >> Advanced >>  How to use lambda

lambda
An anonymous inline function consisting of a single expression which is evaluated when the function is called. The syntax to create a lambda function is lambda [parameters]: expression
Purpose Sample Code


squares = map(lambda x: x**2, range(10))