Which of the following lambda definitions are correct? (Choose two.)
Which of the following lambda definitions are correct? (Choose two.)
In Python, a lambda function is defined as an anonymous function expressed as 'lambda parameters: expression'. Option 'A' is correct because it properly creates a tuple from its parameters 'x' and 'y'. Option 'C' is also correct because the expression 'x//y - x%y' is valid and returns the result of integer division of 'x' and 'y' minus the remainder of 'x' divided by 'y'. Option 'B' is incorrect because 'return' cannot be used in a lambda function. Option 'D' is incorrect because the syntax is invalid for lambda functions.
A. lambda x,y: (x,y) C. lambda x,y: x//y - x%y
#question 111 #lambda x,y = x//y - x%y#SyntaxError: invalid syntax lambda x,y: (x,y) #lambda x,y: return x//y - x%y#SyntaxError: invalid syntax lambda x,y: x//y - x%y Tested: A,C
The answer is A,C