Lambda Function in Python MCQs Exercise I

Ques 1 Lambda Function


Which of the following is false about the lambda function?

A lambda function is also known as anonymous function.
B lambda keyword are used create a lambda function.
C There must be atleast one variable pass in the function
D All of these.

Ques 2 Lambda Function


What is the output of the following Python Code?


li=[1,2,3,4,5,6,7,8,9,10]
filter_list=list(filter(lambda a: a%2==0,li))
print("Filter List:",filter_list)

A Filter List: [1, 3, 5, 7, 9]
B Filter List: [2, 4, 6, 8, 10]
C Filter List: [1,2,3,4,5,6,7,8,9,10]
D Filter List: [1,2,3,4,5,6,7,8,9,11]

Ques 3 Lambda Function


What is the output of the following Python Code?


from functools import reduce
li=[1,2,3,4,5,6,7,8,9,10]
red=reduce((lambda a,b: a*b),li)
print("Result:",red)

A Result: 3328800
B Result: 3628600
C Result: 3629800
D Result: 3628800

Ques 4 Lambda Function


What is the output of the following Python Code?


li=[1,2,3,4,5,6,7,8,9,10]
new_list=list(map(lambda a: a**2,li))
print("New List:",new_list)

A New List: [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]
B New List: [1, 2, 9, 16, 25, 36, 49, 64, 81, 100]
C New List: [1, 4, 9, 16, 25, 36, 64, 81, 100, 121]
D New List: [4, 9, 16, 25, 36, 49, 64, 81, 100]