请问大神,结果为啥都是C的呢?对比了很久,感觉没啥不对的啊
# coding:utf-8
class Person(object):
def __init__(self, name, score):
Person.__name = name
Person.__score = score
def get_grade(self):
if self.__score >= 90:
return 'A'
if self.__score >= 60:
return 'B'
else:
return 'C'
p1 = Person('Bob', 90)
p2 = Person('Alice', 65)
p3 = Person('Tim', 48)
print p1.get_grade()
print p2.get_grade()
print p3.get_grade()