Python: Lambdas as function expressions
How do you define a function inline and then immediately call it? Like this:
>>> (lambda x, y: x + y)(5, 3)
8
This simply states the expression to compute and then immediately evaluates it by calling it like a regular function.
Via dbader.org.
Leave a comment