71. 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)))
def to_upper(k):
return k.upper()
x = ['ab', 'cd']
print(list(map(to_upper, x)))72. What will be the output of the following Python code?
def writer():
title = 'Sir'
name = (lambda x:title + ' ' + x)
return name
who = writer()
who('Arthur')
def writer():
title = 'Sir'
name = (lambda x:title + ' ' + x)
return name
who = writer()
who('Arthur')73. 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))
def sf(a):
return a%3!=0 and a%5!=0
m=filter(sf, range(1, 31))
print(list(m))74. What will be the output of the following Python code?
x = [12, 34]
print(len(list(map(len, x))))
x = [12, 34]
print(len(list(map(len, x))))75. What will be the output of the following Python code?
x = 1234
print(list(map(list, [x])))
x = 1234
print(list(map(list, [x])))76. What will be the output of the following Python code?
l1=[1, 2, 3, (4)]
l2=l1.copy()
l2
l1
l1=[1, 2, 3, (4)]
l2=l1.copy()
l2
l177. What are the two main types of functions?
78. What is the output of the following code:
def greet(name="User"):
print(f"Hello, {name}!")
greet()
def greet(name="User"):
print(f"Hello, {name}!")
greet()79. What will be the output of the following Python code?
x = [12, 34]
print(len(''.join(list(map(str, x)))))
x = [12, 34]
print(len(''.join(list(map(str, x)))))80. What is the output of the following code:
def my_function(a, b):
return a * b
result = my_function(4, 0)
print(result)
def my_function(a, b):
return a * b
result = my_function(4, 0)
print(result)Read More Section(Functions in Python)
Each Section contains maximum 100 MCQs question on Functions in Python. To get more questions visit other sections.
