为什么会出现‘__init__() takes exactly 2 arguments (3 given)’这样的错误提示?
class Preson(object):
def __init__(self,name,score):
self.__name=name
self.__score=score
def get_grade(self):
if self.__score>=85:
print u'A-优秀'
elif self.__score>=60:
print u'B-及格'
else:
print u'C-不及格'
>>> p1=Person('Bob',90)
Traceback (most recent call last):
File "<pyshell#59>", line 1, in <module>
p1=Person('Bob',90)
TypeError: __init__() takes exactly 2 arguments (3 given)