Python Interview Questions

Ref: https://shirsh94.medium.com/top-100-python-interview-questions-and-answers-4c4e9301d9b6

What is lambda Function?

A lambda function is a small anonymous function.

A lambda function can take any number of arguments, but can only have one expression.

https://www.w3schools.com/python/python_lambda.asp

A normal function is defined using the def keyword and can contain multiple statements and complex logic. A lambda function is an anonymous function defined using the lambda keyword and can contain only a single expression. Lambda functions are commonly used for short, one-time operations, especially with functions like map(), filter(), and sorted().








Comments