What is lambda? Why do lambda forms not have statements?



What is lambda? Why do lambda forms not have statements?..

Answer / Pradeep Kumar Gautam

The lambda function is a small anonymous function that is defined without a name. It is used for short, one-off functions that are not worth giving a name or for functions of a single expression like sorting a list. Lambda functions can only contain one expression and cannot have multiple statements.nnPython uses the 'lambda' keyword to define anonymous functions. These functions can be used anywhere function objects are required. They can take any number of arguments, but can only have one expression.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Tell me why and when do you use generators in python?

1 Answers  


what is the statement that can be used in python if the program requires no action but requires a statement syntactically?

1 Answers  


What happens if an error occurs that is not handled in the except block?

1 Answers  


What is abstraction in python?

1 Answers  


Does xrange work python 3?

1 Answers  


What is the use of negative indexes?

1 Answers  


Does python has classes?

1 Answers  


What is the difference between old style and new style classes in python?

1 Answers  


What are identifiers python?

1 Answers  


What is python and python scripting?

1 Answers  


What are cookies python?

1 Answers  


What are *args and *kwargs?

1 Answers  


Categories