Q141
Open questionx = ['ab', 'cd']
print(list(map(list, x)))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
8/10
Page
Pick an option on a question to see the right answer and solution.
Q141
Open questionx = ['ab', 'cd']
print(list(map(list, x)))Select an option to see the answer and solution.
Q142
Open questiondef change(i = 1, j = 2):
i = i + j
j = j + 1
print(i, j)
change(j = 1, i = 2)Select an option to see the answer and solution.
Q143
Open questiondef ram(x):
print(x+1)
x=-2
x=4
ram(12)Select an option to see the answer and solution.
Q144
Open questionx = 50
def func(x):
print('x is', x)
x = 2
print('Changed local x to', x)
func(x)
print('x is now', x)Select an option to see the answer and solution.
Q145
Open questionx = [34, 56]
print((''.join(list(map(str, x)))),)Select an option to see the answer and solution.
Q146
Open questiondef multiply(a, b=2):
return a * b
result = multiply(4)
print(result)Select an option to see the answer and solution.
Q147
Open questionx = 5
def f1():
global x
x = 4
def f2(a,b):
global x
return a+b+x
f1()
total = f2(1,2)
print(total)Select an option to see the answer and solution.
Q148
Open questiondef f1():
x=15
print(x)
x=12
f1()Select an option to see the answer and solution.
Q149
Open questiondef find(a, **b):
print(type(b))
find('letters',A='1',B='2')Select an option to see the answer and solution.
Q150
Open questiondef foo():
return total + 1
total = 0
print(foo())Select an option to see the answer and solution.
Q151
Open questionx = [34, 56]
print(len(map(str, x)))Select an option to see the answer and solution.
Q152
Open questioni=0
def change(i):
i=i+1
return i
change(1)
print(i)Select an option to see the answer and solution.
Q153
Open questiondef foo(x):
x[0] = ['def']
x[1] = ['abc']
return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))Select an option to see the answer and solution.
Q154
Open questionSelect an option to see the answer and solution.
Q155
Open questiona=10
globals()['a']=25
print(a)Select an option to see the answer and solution.
Q156
Open questionSelect an option to see the answer and solution.
Q157
Open questiondef a(b):
b = b + [5]
c = [1, 2, 3, 4]
a(c)
print(len(c))Select an option to see the answer and solution.
Q158
Open questionSelect an option to see the answer and solution.
Q159
Open questionl1=[2, 4, 6, 8]
l2=[1, 2, 3]
l1=l2
l2Select an option to see the answer and solution.
Q160
Open questionelements = [0, 1, 2]
def incr(x):
return x+1
print(list(map(incr, elements)))Select an option to see the answer and solution.