Home > Python > Quizzes > Python Programming Basics Practice Test: Python Functional Programming Tools And Mapping Functions
Python Programming Basics Practice Test: Python Functional Programming Tools And Mapping Functions
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 0% Most missed: “What will be the output of the following Python code?”
Python provides several tools and features that support functional programming, including: Functions: Functions are first-class objects in Python, which means that they can be assigned to variables, passed as arguments to other functions, and returned from functions. Higher-order functions: Higher-order functions are functions that take other functions as arguments or return functions as results. Lambda functions: Lambda functions are anonymous functions that can be defined on the fly. Iterators: Iterators are objects that provide a sequence of values. Generators: Generators are... Show more
Python Programming Basics Practice Test: Python Functional Programming Tools And Mapping Functions
Time left 00:00
25 Questions

1. Which of these is false about a package?
2. What will be the output of the following Python code?
x = ['ab', 'cd']
print(len(list(map(list, x))))))
3. What will be the output of the following Python code?
x = 1234
print(list(map(list, x)))
4. The output of the following codes are the same.
[x**2 for x in range(10)]
list(map((lambda x:x**2), range(10)))
5. What will be the output of the following Python code?
x = 1234
print(list(map(list, [x])))
6. What will be the output of the following Python code?
x = ['ab', 'cd']
print(len(map(list, x)))
7. What will be the output of the following Python code?
x = ['ab', 'cd']
print(list(map(len, x)))
8. What will be the output of the following Python code?
x = [12.1, 34.0]
print(len(' '.join(list(map(str, x)))))
9. What will be the output of the following Python code?
def to_upper(k):
return k.upper()
x = ['ab', 'cd']
print(list(map(to_upper, x)))
10. What will be the output of the following Python code?
x = abcd
print(list(map(list, x)))
11. What will be the output of the following Python code?
def to_upper(k):
k.upper()
x = ['ab', 'cd']
print(list(map(to_upper, x)))
12. What will be the output of the following Python code?
x = [[0], [1]]
print((' '.join(list(map(str, x))),))
13. What will be the output of the following Python code?
list(map((lambda x:x^2), range(10)))
14. What will be the output of the following Python code?
list(map((lambda x:x**2), filter((lambda x:x%2==0), range(10))))
15. What will be the output of the following Python code?
x = [12, 34]
print(len(list(map(int, x))))
16. What will be the output of the following Python code?
x = [12, 34]
print(len(list(map(len, x))))
17. What will be the output of the following Python code?
def to_upper(k):
return k.upper()
x = ['ab', 'cd']
print(list(map(upper, x)))
18. What will be the output of the following Python code?
x = [34, 56]
print((''.join(list(map(str, x))),))
19. What will be the output of the following Python code?
elements = [0, 1, 2]
def incr(x):
return x+1
print(list(map(incr, elements)))
20. What will be the output of the following Python code?
x = [12.1, 34.0]
print(' '.join(list(map(str, x))))
21. Is Python code compiled or interpreted?
22. Which of the following numbers will not be a part of the output list of the following Python code?
def sf(a):
return a%3!=0 and a%5!=0
m=filter(sf, range(1, 31))
print(list(m))
23. What will be the output of the following Python code?
x = 'abcd'
print(list(map([], x)))
24. What will be the output of the following Python code?
x = [[0], [1]]
print(len(' '.join(list(map(str, x)))))
25. What will be the output of the following Python code?
x = [12, 34]
print(len(''.join(list(map(int, x)))))