  ## Python Practice Test MCQ Certified Go from 0 to Expert hero Set 30

##### What will be the output of the following Python code?`l=[1, 2, 3, 4, 5]m=map(lambda x:2**x, l)print(list(m))`

Options are :

• [1, 4, 9, 16, 25 ]
• [2, 4, 8, 16, 32 ]
• [1, 0, 1, 0, 1]
• Error

Answer :[2, 4, 8, 16, 32 ]

Options are :

• Error
• 1
• 5

##### What will be the output of the following Python code?`l=[n for n in range(5)]f=lambda x:bool(x%2)print(f(3), f(1))for i in range(len(l)): if f(l[i]): del l[i] print(i)`

Options are :

• True True 1 2 Error
• False False 1 2
• True False 1 2 Error
• False True 1 2

Answer :True True 1 2 Error

##### What will be the output of the following Python code?`m=reduce(lambda x: x-3 in range(4, 10))print(list(m))`

Options are :

• [1, 2, 3, 4, 5, 6, 7]
• No output
• [1, 2, 3, 4, 5, 6]
• Error

Options are :

• 1
• 29
• 6
• 10

##### The single line equivalent of the following Python code?`l=[1, 2, 3, 4, 5]def f1(x): return x<0m1=filter(f1, l)print(list(m1))`

Options are :

• filter(lambda x:x<0, l)
• filter(lambda x, y: x<0, l)
• filter(reduce x<0, l)
• reduce(x: x<0, l)

##### What will be the output of the following Python code?`list(map((lambda x:x^2), range(10)))`

Options are :

• [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
• Error
• [2, 3, 0, 1, 6, 7, 4, 5, 10, 11]
• No output

Answer :[2, 3, 0, 1, 6, 7, 4, 5, 10, 11]

##### What will be the output of the following Python code?`list(map((lambda x:x**2), filter((lambda x:x%2==0), range(10))))`

Options are :

• [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
• [0, 4, 16, 36, 64]
• Error
• No output

Answer :[0, 4, 16, 36, 64]

Options are :

• True
• False

##### What will be the output of the following Python code?`elements = [0, 1, 2]def incr(x): return x+1print(list(map(elements, incr)))`

Options are :

• [1, 2, 3]
• [0, 1, 2]
• error
• none of the mentioned

##### What will be the output of the following Python code?`elements = [0, 1, 2]def incr(x): return x+1print(list(map(incr, elements)))`

Options are :

• [1, 2, 3]
• [0, 1, 2]
• error
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(list(map(upper, x)))`

Options are :

• ['AB', 'CD']
• ['ab', 'cd']
• error
• none of the mentioned

##### 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)))`

Options are :

• ['AB', 'CD']
• ['ab', 'cd']
• none of the mentioned
• error

##### 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)))`

Options are :

• ['AB', 'CD']
• ['ab', 'cd']
• none of the mentioned
• error

##### 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)))`

Options are :

• ['AB', 'CD']
• ['ab', 'cd']
• none of the mentioned
• error

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(map(len, x))`

Options are :

• ['ab', 'cd']
• [2, 2]
• ['2', '2']
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(list(map(len, x)))`

Options are :

• ['ab', 'cd']
• [2, 2]
• ['2', '2']
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(len(map(list, x)))`

Options are :

• [2, 2]
• 2
• 4
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(len(list(map(list, x))))`

Options are :

• 2
• 4
• error
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(len(list(map(list, x))))))`

Options are :

• 2
• 4
• error
• none of the mentioned

##### What will be the output of the following Python code?`x = ['ab', 'cd']print(list(map(list, x)))`

Options are :

• ['a', 'b', 'c', 'd']
• [['ab'], ['cd']]
• [['a', 'b'], ['c', 'd']]
• none of the mentioned

##### What will be the output of the following Python code?`x = [12, 34]print(len(list(map(len, x))))`

Options are :

• 2
• 1
• error
• none of the mentioned

##### What will be the output of the following Python code?`x = [12, 34]print(len(list(map(int, x))))`

Options are :

• 2
• 1
• error
• none of the mentioned

Options are :

• 4
• 5
• 6
• error

Options are :

• 4
• 5
• 6
• error

Options are :

• 6
• 8
• 9
• error

Options are :

• 12 1 34 0
• 12.1 34
• 121 340
• 12.1 34.0

Options are :

• 2
• 3
• 7
• 8

Options are :

• (' ',)
• ('01',)
•  
• 01

Options are :

• (' ',)
• ('01')
•  
• 01