Explanation:
A lambda function in Python is an anonymous function that can have zero or more arguments but must consist of a single expression.
The correct answers are:
C. lambda : 3.1415
This is a valid lambda function with no arguments (lambda :) that always returns 3.1415.
D. lambda x : None
This is a valid lambda function that takes one argument (x) and always returns None.
The incorrect answers are:
A. lambda lambda: lambda * lambda
The syntax is invalid because lambda is a reserved keyword in Python and cannot be used as a variable name.
This will result in a SyntaxError.
B. lambda x : def fun(x): return x
The syntax is invalid because lambda functions cannot contain statements like def.
This will result in a SyntaxError.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
flthymcnsty
1 month ago