第1个回答 2012-12-27
class Complex:
def __init__(r, v):
self.r = r
self.v = v
def __add__(self, another):
return Complex(self.r + another.r, self.v + another.v)
def __radd__(self, another):
self.r += another.r
self.v += another.v
return self
...本回答被提问者采纳