>>> a=[14,52,7]
>>>> b=a.copy()
>>> b is aSelect 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
4/8
Page
Pick an option on a question to see the right answer and solution.
>>> a=[14,52,7]
>>>> b=a.copy()
>>> b is aSelect an option to see the answer and solution.
Select an option to see the answer and solution.
names1 = ['Amir', 'Bear', 'Charlton', 'Daman']
names2 = names1
names3 = names1[:]
names2[0] = 'Alice'
names3[1] = 'Bob'
sum = 0
for ls in (names1, names2, names3):
if ls[0] == 'Alice':
sum += 1
if ls[1] == 'Bob':
sum += 10
print sumSelect an option to see the answer and solution.
Select an option to see the answer and solution.
[ord(ch) for ch in 'abc']Select an option to see the answer and solution.
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
B = [[3, 3, 3],
[4, 4, 4],
[5, 5, 5]]
[B[row][col]*A[row][col] for row in range(3) for col in range(3)]Select an option to see the answer and solution.
Select an option to see the answer and solution.
Select an option to see the answer and solution.
k = [print(i) for i in my_string if i not in "aeiou"]
print(k)Select an option to see the answer and solution.
for i in range(1, 101):
if int(i*0.5)==i*0.5:
print(i)Select an option to see the answer and solution.
Select an option to see the answer and solution.
>>>list1 = [1, 3]
>>>list2 = list1
>>>list1[0] = 4
>>>print(list2)Select an option to see the answer and solution.
data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
def ttt(m):
v = m[0][0]
for row in m:
for element in row:
if v < element: v = element
return v
print(ttt(data[0]))Select an option to see the answer and solution.
word1="Apple"
word2="Apple"
list1=[1,2,3]
list2=[1,2,3]
print(word1 is word2)
print(list1 is list2)Select an option to see the answer and solution.
Select an option to see the answer and solution.
names1 = ['Amir', 'Bala', 'Chales']
if 'amir' in names1:
print(1)
else:
print(2)Select an option to see the answer and solution.
a=165
b=sum(list(map(int,str(a))))
print(b)Select an option to see the answer and solution.
a=[[]]*3
a[1].append(7)
print(a)Select an option to see the answer and solution.
def unpack(a,b,c,d):
print(a+d)
x = [1,2,3,4]
unpack(*x)Select an option to see the answer and solution.
print([if i%2==0: i; else: i+1; for i in range(4)])Select an option to see the answer and solution.