What needs to be added for the output to be True?
from abc import ABC
class L(ABC): pass
# your code
print(issubclass(tuple, L))
Choose your answer
Anonymous Quiz
19%
L.add(tuple)
9%
L += tuple
9%
L.include(tuple)
19%
L.register(tuple)
16%
L.inherit(tuple)
3%
L.extend(tuple)
25%
See solution
How to import a module if its name is in the module_name variable?
Anonymous Quiz
23%
import module_name
26%
from module_name import *
10%
import importlib; m = importlib.import_module(module_name)
3%
import module; m = module.import(module_name)
10%
from _future_ import module_name
6%
import "module_name"
23%
See solution
👎1
What will this code do?
print(isinstance(True, int), isinstance(True, bool))
Choose your answer
Anonymous Quiz
7%
False False
36%
False True
14%
True False
36%
True True
7%
See solution
What will this code do?
S = 'Hello, Max!'.isalnum()
try:
10/S
except:
print('Buy, Max')
else:
print('See you tomorrow')
Choose your answer
Anonymous Quiz
6%
Hello, Max!
56%
Buy, Max
28%
See you tomorrow
6%
ZeroDivisionError
4%
See solution
What will this code do?
"".join(chr(i) if i % 2 else chr(i).upper() for i in range(ord('a'), ord('e')))Choose your answer
Anonymous Quiz
0%
abcd
3%
ABCD
38%
AbCd
13%
AbCd
34%
aBcD
6%
Error
6%
See solution
What will this code do?
False ** False + True * 2 + ([] or (True + False))
Choose your answer
Anonymous Quiz
9%
2
19%
3
30%
4
5%
5
5%
True
5%
False
5%
None
12%
TypeError
0%
SyntaxError
12%
See solution
What will this code do?
import numpy as np
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
c = a + b
c = c * a
print(c[1])
🤩1
👍1
What will this code do?
def f(n):
s = 0
for i in range(n):
s += i
s += ~i
return s
print(f(1) + f(10) + f(100))
🤩1
Choose your answer
Anonymous Quiz
5%
-9990
0%
-4995
19%
-111
14%
0
12%
111
12%
4995
10%
9990
29%
See solution
🎉2
👍2
Which of the classes from the scikit-learn library does NOT solve the problem of regression?
Anonymous Quiz
17%
DecisionTreeRegressor
20%
RandomForestRegressor
20%
LinearRegression
37%
LogisticRegression
7%
See solution
👍1
What will this code do?
class MyList(list):
def __getitem__(self, index):
if type(index) is slice:
index = slice(index.start - 1, index.stop - 1, index.step)
elif type(index) is int:
index -= 1
return list.__getitem__(self, index)
l = MyList(["one", "two", "three", "four", "five", "six"])
print(l[1], l[-1], l[0], l[2:4])