Choose your answer
Anonymous Quiz
26%
[1, 2, 4]
5%
[1, 1, 1]
2%
[2, 2, 2]
33%
[4, 4, 4]
17%
AttributeError
0%
TypeError
0%
ValueError
17%
See solution
👍1
Choose your answer
Anonymous Quiz
22%
True
50%
False
5%
AttributeError
3%
ValueError
17%
TypeError
3%
See solution
What will this code do?
1 > 1 or {} or 'hello' or type('hello') is str and FalseChoose your answer
Anonymous Quiz
27%
True
42%
False
10%
'hello'
0%
str
2%
{}
8%
TypeError
2%
ValueError
8%
See solution
😱4
Choose your answer
Anonymous Quiz
22%
True
8%
False
2%
nan
0%
None
56%
TypeError
5%
ValueError
3%
AttributeError
2%
SyntaxError
2%
See solution
What will this code do?
(lambda x: x**2 if '' or None or 1 and [False] else lambda x: x*2)(3)
Choose your answer
Anonymous Quiz
0%
1
0%
3
35%
6
42%
9
5%
12
2%
None
5%
TypeError
0%
AttributeError
5%
IndexError
7%
See solution
Given code (Python3):
class A:
# your code
def f():
print('hi')
a = A()
a.f()
Given code (Python3):
class A:
# your code
def f():
print('hi')
a = A()
A.f()
You are required to print Method Resolution Order (MRO) for class D.
Which method would you use and what will be the order of the classes?
Which method would you use and what will be the order of the classes?
Anonymous Quiz
39%
__mro__ and D, C, A, B, object
4%
mro and D, C, A, B, object
7%
__mro__ and D, C, B, A, object
0%
mro and D, C, B, A, object
7%
__mro__ and C, A, B
18%
__mro__ and D, C, A, B
4%
__mro__ and D, C, B, A
0%
__mro__ and D, C, A
4%
There's no such method
18%
See solution
What will this code do?
import numpy as np
a = np.array([[1, 2, 3], [4, 5, 6]])
print(a.reshape(1, -1))