lambdaIntermediate Playground

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

Python Playground
Output
Click "Run" to execute your code

lambda shines as a throwaway function passed to higher-order functions. For anything more than one expression, use def instead.

Challenge

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