Python Mapping Function: MCQs on Mapping Function

Python Mapping Function. Multiple Choice Questions on the topic of Mapping Functions in Python Programming Language.

 

Python Mapping Function

 

 

What will be the output of the following Python ??

x = [[0], [1]]
print(len(‘ ‘.join(list(map(str, x)))))

a) 2
b) 3
c) 7
d) 8

 

What will be the output ??

x = [‘ab’, ‘cd’]
print(len(list(map(list, x))))

a) 2
b) 4
c) error
d) none of the mentioned

 

What will be the output of the following ??

x = [12.1, 34.0]
print(‘ ‘.join(list(map(str, x))))

a) 12 1 34 0
b) 12.1 34
c) 121 340
d) 12.1 34.0

 

What will be the output of the following code ??

x = [‘ab’, ‘cd’]
print(len(map(list, x)))

a) [2, 2]
b) 2
c) 4
d) none of the mentioned

 

Python Mapping Function

 

What will be the output ??

x = [12.1, 34.0]
print(len(‘ ‘.join(list(map(str, x)))))

a) 6
b) 8
c) 9
d) error

 

What will be the output of the code ??

x = [‘ab’, ‘cd’]
print(list(map(len, x)))

a) [‘ab’, ‘cd’]
b) [2, 2]
c) [‘2’, ‘2’]
d) none of the mentioned

 

What is the output ??

x = [12, 34]
print(len(‘ ‘.join(list(map(int, x)))))

a) 4
b) 5
c) 6
d) error

 

What will be the output of this code ??

x = [‘ab’, ‘cd’]
print(map(len, x))

a) [‘ab’, ‘cd’]
b) [2, 2]
c) [‘2’, ‘2’]
d) none of the mentioned

 

Python Mapping Function

 

What will be the output of the following Python code ??

x = [12, 34]
print(len(”.join(list(map(str, x)))))

a) 4
b) 5
c) 6
d) error

 

What will be the output of ??

def to_upper(k):
k.upper()
x = [‘ab’, ‘cd’]
print(list(map(to_upper, x)))

a) [‘AB’, ‘CD’]
b) [‘ab’, ‘cd’]
c) none of the mentioned
d) error

 

What will be the output of the following Python code snippet ??

x = [12, 34]
print(len(”.join(list(map(int, x)))))

a) 4
b) 2
c) error
d) none of the mentioned

 

What will be the output of following code snippet ??

def to_upper(k):
return k.upper()
x = [‘ab’, ‘cd’]
print(list(map(to_upper, x)))

a) [‘AB’, ‘CD’]
b) [‘ab’, ‘cd’]
c) none of the mentioned
d) error

 

Python Mapping Function

 

What is output of the following Python code ??

x = [12, 34]
print(len(list(map(int, x))))

a) 2
b) 1
c) error
d) none of the mentioned

 

What is the output ??

def to_upper(k):
return k.upper()
x = [‘ab’, ‘cd’]
print(list(map(upper, x)))

a) [‘AB’, ‘CD’]
b) [‘ab’, ‘cd’]
c) none of the mentioned
d) error

 

What will be the output of following ??

x = [12, 34]
print(len(list(map(len, x))))

a) 2
b) 1
c) error
d) none of the mentioned

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!