What is lambda function in python?



Vikas Said

+0 -0

Lambda function is a anonymous function is work like a normal function except the declaration of function and it contains one line of code.



Ayush Said

+0 -0

A lambda function in Python is a small, anonymous function that can take any number of arguments but can only have one expression.
They are often used as arguments to other functions, such as map(), filter(), and reduce().
Lambda functions are useful for creating short, throw-away functions for tasks that require only a single expression, and can make code more concise and readable.



Submit Your Response