lambdaAdvanced Playground

Creates a small anonymous (unnamed) function in a single expression

Python Playground
Output
Click "Run" to execute your code

Lambda captures variables by reference, not by value. The default argument trick (lambda i=i: ...) forces capture at definition time.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?