class A:
def __init__(self, x):
self.x = x
def __and__(self, other):
return self.x + other.x
a1 = A(1)
a2 = A(2)
# ваш код
Вывод: 3
PY Python Tasks & ML | Задачи по питону и машинному обучению @python_tasks · 8.49K subscribers class A:
def __init__(self, x):
self.x = x
def __and__(self, other):
return self.x + other.x
a1 = A(1)
a2 = A(2)
# ваш код