Q121
Open questiona=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)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.
147
Questions
7/8
Page
Pick an option on a question to see the right answer and solution.
Q121
Open questiona=[13,56,17]
a.append([87])
a.extend([45,67])
print(a)Select an option to see the answer and solution.
Q122
Open questiondata = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
print(data[1][0][0])Select an option to see the answer and solution.
Q123
Open questionnumbers = [1, 2, 3, 4]
numbers.append([5,6,7,8])
print(len(numbers))Select an option to see the answer and solution.
Q124
Open questionSelect an option to see the answer and solution.
Q125
Open questionSelect an option to see the answer and solution.
Q126
Open questionSelect an option to see the answer and solution.
Q127
Open questionA = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
B = [[3, 3, 3],
[4, 4, 4],
[5, 5, 5]]
[[col1 * col2 for (col1, col2) in zip(row1, row2)] for (row1, row2) in zip(A, B)]Select an option to see the answer and solution.
Q128
Open question>>>"Welcome to Python".split()Select an option to see the answer and solution.
Q129
Open questionnum = ['One', 'Two', 'Three']
for i, x in enumerate(num):
print('{}: {}'.format(i, x),end=" ")Select an option to see the answer and solution.
Q130
Open question>>>list("a#b#c#d".split('#'))Select an option to see the answer and solution.
Q131
Open questiondef change(var, lst):
var = 1
lst[0] = 44
k = 3
a = [1, 2, 3]
change(k, a)
print(k)
print(a)Select an option to see the answer and solution.
Q132
Open questionSelect an option to see the answer and solution.
Q133
Open question{x : x is a whole number less than 20, x is even} (including zero)Select an option to see the answer and solution.
Q134
Open questionvalues = [[3, 4, 5, 1], [33, 6, 1, 2]]
v = values[0][0]
for lst in values:
for element in lst:
if v > element:
v = element
print(v)Select an option to see the answer and solution.
Q135
Open questionl=["good", "oh!", "excellent!", "#450"]
[n for n in l if n.isalpha() or n.isdigit()]Select an option to see the answer and solution.
Q136
Open questionSelect an option to see the answer and solution.
Q137
Open questionmyList = [1, 2, 3, 4, 5, 6]
for i in range(1, 6):
myList[i - 1] = myList[i]
for i in range(0, 6):
print(myList[i], end = " ")Select an option to see the answer and solution.
Q138
Open questionSelect an option to see the answer and solution.
Q139
Open questionm = [[x, y] for x in range(0, 4) for y in range(0, 4)]Select an option to see the answer and solution.
Q140
Open questionSelect an option to see the answer and solution.