Выберите правильный вариант
Anonymous Quiz
60%
[0, 1, 2]
12%
[1, 2]
3%
[2]
19%
(0, 1, 2)
3%
(1, 2)
0%
(2)
0%
None
2%
TypeError
0%
Посмотреть результаты
Что выведет код?
def f():
import sys
locs = sys._getframe(1).f_locals
setattr(locs['self'], 'xy', 4*locs['x'] + 7*locs['y'])
class A:
def __init__(self, x, y):
self.xy = 2*x + 3*y
f()
a = A(2, 3)
A.xy = 99
print(a.xy)
Выберите правильный вариант
Anonymous Quiz
5%
12
15%
13
24%
26
27%
29
20%
99
5%
TypeError
5%
Посмотреть результаты