What will this code do?
def f(x, y):
return x ** y
print(f.__call__(3, 2) + f(2, 3))
Choose your answer
Anonymous Quiz
10%
8
0%
9
5%
10
5%
16
62%
17
0%
27
10%
AttributeError
10%
See solution
Choose your answer
Anonymous Quiz
7%
'1110'
14%
'11o10'
7%
'110o10'
29%
'0b110o10'
0%
'0o1011'
14%
'110b1000'
7%
'30o10'
21%
See solution
How to print out a list of already installed python libraries?
Anonymous Quiz
20%
pip show
0%
pip search
0%
pip check
60%
pip list
0%
pip completion
8%
pip cache
12%
See solution
What will this code do?
d = {"id": 1, "person": {"name": "Vasya", "age": 18}}
d1 = d.copy()
d1["person"]["age"] += 1
d2 = d
d2["person"]["age"] += 1
print(d["person"]["age"])Choose your answer
Anonymous Quiz
16%
18
16%
19
58%
20
11%
TypeError
0%
AttributeError
0%
See solution
What will this code do?
d = {}
print(d.get("a", 0) + d.setdefault("a", 10) + d.get("a", 0))Choose your answer
Anonymous Quiz
12%
0
18%
10
35%
20
0%
30
12%
TypeError
12%
AttributeError
12%
See solution
What will this code do?
a = True
b= False
c = {True, False}
not b and b not in c or not a not in c
What will this code do?
keys = ["a", "b", "c", "d"]
values = [1, 2, 3, 4]
dict_ = {key: value for (key, value) in zip(keys, values)}
dict_ = {key:value for (key, value) in dict_.items() if value % 2 == 1}
sum([value for value in dict_.values()], 5)