61. The output of the following codes are the same.
[x**2 for x in range(10)]
list(map((lambda x:x**2), range(10)))
[x**2 for x in range(10)]
list(map((lambda x:x**2), range(10)))
62. What will be the output of the following Python code?
x = [12.1, 34.0]
print(len(' '.join(list(map(str, x)))))
x = [12.1, 34.0]
print(len(' '.join(list(map(str, x)))))
63. What is the base case in the Merge Sort algorithm when it is solved recursively?
64. What will be the output of the following Python code?
x=100
def f1():
global x
x=90
def f2():
global x
x=80
print(x)
x=100
def f1():
global x
x=90
def f2():
global x
x=80
print(x)
65. . . . . . . . . returns a dictionary of the module namespace.
. . . . . . . . returns a dictionary of the current namespace.
. . . . . . . . returns a dictionary of the current namespace.
66. What will be the output of the following Python code?
x = [[0], [1]]
print((' '.join(list(map(str, x)))))
x = [[0], [1]]
print((' '.join(list(map(str, x)))))
67. Which keyword is used for function?
68. What will be the output of the following Python code?
x = ['ab', 'cd']
print(len(map(list, x)))
x = ['ab', 'cd']
print(len(map(list, x)))
69. How can you define a function that accepts both positional and keyword arguments?
70. If a function doesn't have a return statement, which of the following does the function return?
Read More Section(Functions in Python)
Each Section contains maximum 100 MCQs question on Functions in Python. To get more questions visit other sections.