Home »
MCQs »
Python MCQs
Amongst which of the following is a function which does not have any name?
56. Amongst which of the following is a function which does not have any name?
- Del function
- Show function
- Lambda function
- None of the mentioned above
Answer: C) Lambda function
Explanation:
Lambda function is an anonymous function, which means that it does not have a name, as opposed to other functions. Unlike other programming languages, Python allows us to declare functions without using the def keyword, which is what we would normally do to declare a function. As an alternative, the lambda keyword is used to declare the anonymous functions that will be used throughout the program. When compared to other functions, lambda functions can accept any number of arguments, but they can only return a single value, which is represented by an expression.
Syntax:
lambda arguments: expression