Direction: Choose the correct option
Q1.
How do you define a lambda function?
Direction: Choose the correct option
Q2.
What does `lambda x, y: x + y` return?
Direction: Choose the correct option
Q3.
What is the output of `(lambda x: x*2)(3)`?
Direction: Choose the correct option
Q4.
Where are lambda functions commonly used?
Direction: Choose the correct option
Q5.
What does `list(map(lambda x: x*2, [1,2,3]))` produce?
Direction: Choose the correct option
Q6.
What does `filter(lambda x: x>2, [1,2,3,4])` return?
Direction: Choose the correct option
Q7.
Can lambda functions contain statements?
Direction: Choose the correct option
Q8.
What is the result of `sorted(['abc','de','f'], key=lambda s: len(s))`?
Direction: Choose the correct option
Q9.
What does `(lambda a, b: a if a > b else b)(5, 3)` return?
Direction: Choose the correct option
Q10.
How do you assign a lambda to a variable?
