Choose your answer
Anonymous Quiz
0%
[1, 2]
0%
[1]
3%
1
5%
3
0%
[3]
32%
[3, 7]
8%
[10]
30%
10
11%
Error
11%
See solution
What will this code do?
a = {1: "London", 3: "Berlin"}
b = {2: "New York", 3: "Moscow", 4: "Geneva"}
c = {**a, **b}
print(c)What will this code do?
import numpy as np
matrix_a = np.array([
[1, 1, 1],
[1, 1, 1],
[1, 1, 2]
])
matrix_b = np.array([
[1, 3, 1],
[1, 3, 1],
[1, 3, 8]
])
с = matrix_a + matrix_b
print(с)
What will this code do?
c = map(lambda x: x + x, filter(lambda x: x>3, (1, 2, 3, 4)))
print(list(c))
Choose your answer
Anonymous Quiz
5%
[2, 4, 6, 8]
68%
[8]
11%
[6, 8]
7%
[4, 4]
0%
[6]
5%
None
4%
See solution
What will this code do?
import numpy as np
a = np.array([1, 2, 3])
print(np.dot(a, a.T))
What will this code do?
c = filter(lambda x: x>=3, map(lambda x: x+x, (1, 2, 3, 4)))
print(list(c))
Choose your answer
Anonymous Quiz
7%
TypeError
5%
[3, 4]
13%
[6, 8]
66%
[4, 6, 8]
2%
[8]
0%
[2, 3, 4]
7%
See solution
What will this code do?
def unpacking(x, y, z):
print(x, y, z, end=" ")
tuple_vec = (1, 0, 1)
dict_vec = {'x': 1, 'y': 0, 'z': 1}
unpacking(*tuple_vec)
unpacking(**dict_vec)
Choose your answer
Anonymous Quiz
2%
1 0 1
5%
1 0 1 1 1 0
66%
1 0 1 1 0 1
2%
1 : 1 0 : 0 1 : 1
11%
{'x': 1, 'y': 0, 'z': 1}
9%
TypeError
5%
See solution
😱6
What will this code do?
class B:
def __init__(self):
self.arr = []
def __getattr__(self, attrname):
return getattr(self.arr, attrname)
b = B()
b.append(1)
b.append(2)
b.append(3)
b.pop()
print(b.arr)
Choose your answer
Anonymous Quiz
23%
AttributeError
6%
[1, 2, 3]
51%
[1, 2]
11%
TypeError
9%
See solution
Choose your answer
Anonymous Quiz
17%
[1, 2, 3, 4]
1%
(1, 2, 3, 4)
69%
'1,2,3,4'
13%
'1234'
0%
See solution