hello
i want too add class A with class B but this problem occurs
(i want to experiment with the code so that's why i made 2 classes)
thank you
i want too add class A with class B but this problem occurs
(i want to experiment with the code so that's why i made 2 classes)
Error:TypeError: unsupported operand type(s) for +: 'int' and 'Chair'class Table:
def __init__(self, x):
self.x = x
self.y = Chair(self)
def __add__(self, other):
self.x + self.y
class Chair:
def __init__(self, y):
self.y = y
taw = Table(1)
kor = Chair(20)
print(taw + kor)im still kinda new with Object-Oriented Programming thank you
