Code-Memo

Lambda Functions

Lambda functions are small anonymous functions defined with the lambda keyword. They can have any number of arguments but only one expression.

square = lambda x: x ** 2
print(square(5))  # Output: 25

Using Lambda with map(), filter(), and reduce()