Choose your answer
Anonymous Quiz
7%
True
7%
False
34%
0
7%
1
10%
13
24%
SyntaxError
10%
See solution
Choose your answer
Anonymous Quiz
3%
I have 10 cars
16%
True
68%
False
0%
None
3%
AttributeError
11%
See solution
What will this code do?
import numpy as np
A = np.random.randint(1, 100, size=(5, 5))
B = A.copy()
B[:, [0, -1]] = B[:, [-1, 0]]
d = lambda x: round(np.linalg.det(x))
print(d(A) + d(B))
What will this code do?
bin(2**2) == bin(2**3 >> 1), bin(2**2) is bin(2**3 >> 1)
Choose your answer
Anonymous Quiz
25%
(True, True)
42%
(True, False)
17%
(False, True)
13%
(False, False)
4%
See solution
Given code
output - True
class C: pass
class D (C): __slots__ = ['a']
X = D()
X.a = 1
print(hasattr(X, '__dict__'))
output - True
What should be written in class C instead of 'pass' so that the output is False?
Anonymous Quiz
0%
a = 1
6%
del __dict__
18%
del self.__dict__
24%
__slots__ = ['a']
29%
def __init__(self): del self.__dict__
24%
See solution