A. False (uses an = sign and parentheses, which is incorrect syntax).
B. False (uses the return statement, which is not allowed in a lambda).
C. True (correctly defines a lambda that returns a tuple as the expression).
D. True (correctly defines a lambda that returns the result of a single expression).
A. lambda(x,y) = x//y - x%y ------ > SyntaxError: Lambda expression parameters cannot be parenthesized
B. lambda x,y: return x//y - x%y ----> Lambda function not returning the values.
So C & D is the correct expression.
C. lambda x,y: (x,y)
D. lambda x,y: x//y - x%y
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.
Abbribas
1 week, 3 days agojarun2024
10 months, 1 week agoDave304409
11 months, 2 weeks agoDKAT2023
12 months ago