Q161
Open questiondef foo(k):
k[0] = 1
q = [0]
foo(q)
print(q)Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
182
Questions
9/10
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questiondef foo(k):
k[0] = 1
q = [0]
foo(q)
print(q)Select an option to see the answer and solution.
Q162
Open questionl=[2, 3, [4, 5]]
l2=l.copy()
l2[0]=88
l
l2Select an option to see the answer and solution.
Q163
Open questionx = [12, 34]
print(len(' '.join(list(map(int, x)))))Select an option to see the answer and solution.
Q164
Open questionx = [12.1, 34.0]
print(' '.join(list(map(str, x))))Select an option to see the answer and solution.
Q165
Open questionSelect an option to see the answer and solution.
Q166
Open questionx=1
def cg():
global x
x=x+1
cg()
xSelect an option to see the answer and solution.
Q167
Open questione="butter"
def f(a): print(a)+e
f("bitter")Select an option to see the answer and solution.
Q168
Open questiondef change(one, *two):
print(type(two))
change(1,2,3,4)Select an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionSelect an option to see the answer and solution.
Q171
Open questiondef to_upper(k):
return k.upper()
x = ['ab', 'cd']
print(list(map(to_upper, x)))Select an option to see the answer and solution.
Q172
Open questiondef writer():
title = 'Sir'
name = (lambda x:title + ' ' + x)
return name
who = writer()
who('Arthur')Select an option to see the answer and solution.
Q173
Open questiondef sf(a):
return a%3!=0 and a%5!=0
m=filter(sf, range(1, 31))
print(list(m))Select an option to see the answer and solution.
Q174
Open questionx = [12, 34]
print(len(list(map(len, x))))Select an option to see the answer and solution.
Q175
Open questionx = 1234
print(list(map(list, [x])))Select an option to see the answer and solution.
Q176
Open questionl1=[1, 2, 3, (4)]
l2=l1.copy()
l2
l1Select an option to see the answer and solution.
Q177
Open questionSelect an option to see the answer and solution.
Q178
Open questiondef greet(name="User"):
print(f"Hello, {name}!")
greet()Select an option to see the answer and solution.
Q179
Open questionx = [12, 34]
print(len(''.join(list(map(str, x)))))Select an option to see the answer and solution.
Q180
Open questiondef my_function(a, b):
return a * b
result = my_function(4, 0)
print(result)Select an option to see the answer and solution.