class aa(object): def __init__(self,x): self.val=x def __add__(self,other): x=self.val-other.val return x a=aa(10) b=aa(2) c=b+a print(c)
class aa(object): def __init__(self,x): self.val=x def __add__(self,other): x=self.val-other.val return x a=aa(10) b=aa(2) c=b+a print(c)
转载于:https://www.cnblogs.com/xzm123/p/9847776.html