lass learnclass:
def classadd(a,b):
return a+b
>>> learnclass.classadd(1,2)
Traceback (most recent call last):
File "<pyshell#88>", line 1, in <module>
learnclass.classadd(1,2)
TypeError: unbound method classadd() must be called with learnclass instance as first argument (got int instance instead)
为什么会出现错误