给定Python代码如下:
class Num:
def __init__(self,val):
self.Value = val
def __add__(self,other):
return self.Value + other.Value
def add(self,other):
return self.Value + other.Value
a = Num(10)
print(a + Num(20), Num(20).__add__(a), a.add(Num(20)))
print(a)