class polynomial:
def __init__(self, *coeff):
self.coeff = coeff
def __repr__(self):
return 'polynomial(*{!r})'.format(self.coeff)
def __add__(self, other):
return polynomial(*(x + y for x, y in zip(self.coeff, other.coeff))
g = polynomial(1, 2, 3)
d = polynomial(3, 3, 4)
我正在尝试学习 python,现在我正在尝试掌握课程的窍门,并且我提出了这个错误 g = polynomial(1, 2, 3) ^ SyntaxError: invalid syntax