如果用print "A", print "B", print "C", 打印结果是下面的结果1如果用 return "A", return "B", return "C", 打印结果是线面的2问: 为什么会出现结果1 ?class Person(object): def __init__(self, name, score): self.__name = name self.__score = score def get_grade(self): if self.__score >= 80: print "A" elif self.__score < 60: print 'C' print 'B' p1 = Person('Bob', 90)p2 = Person('Alice', 65)p3 = Person('Tim', 48)print p1.get_grade()print p2.get_grade()print p3.get_grade()结果1:ABNoneBNoneCBNone结果2:ABC
目前暂无任何回答
- 0 回答
- 0 关注
- 1205 浏览
添加回答
举报
0/150
提交
取消