culTest

    One of the 50 questions in this topic

    How much do you know about Python?

    What is a lambda function in Python?

    Answers

    A function that runs automatically
    An anonymous function defined in a single expressionCorrect
    A function that only accepts lists as parameters
    A function that returns multiple values

    A lambda function is an anonymous (unnamed) function defined in a single expression, created with the lambda keyword. For example: lambda x, y: x + y you define a function that adds two parameters. Lambdas are limited to a single expression and cannot contain declarations or annotations. They are useful for simple functions that are passed as arguments to higher-order functions such as map(), filter() or sort().