
Python Quiz 2
Authored by 21RU5A0505 KRISHNAVENI
Other
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
34 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following functions is not a built-in functional programming tool in Python?
map()
filter()
reduce()
sorted()
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is The map() function in Python
Filters elements based on a condition
Transforms each element using a function(apply on each element)
Reduces a sequence to a single value
Sorts a sequence
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which import is required to use reduce() in Python?
import collections
import itertools
from functools import reduce
from operator import reduce
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the correct syntax of a lambda function?
Note:Without Storing in a variable
lambda (x, y): x + y
lambda x, y: x + y
def lambda(x, y): return x + y
def (x, y): return x + y
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will the following code output?
f = lambda x: x * 2
print(f(5))
5
10
25
error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following statements about lambda is TRUE?
lambda can contain multiple return statements.
lambda can take multiple arguments but only one expression.
lambda is faster than normal functions.
lambda must always be named.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the code return?
add = lambda a, b=10: a + b
print(add(5))
5
10
15
Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?