5、小明写了一段代码想输出同学的成绩,看看他有没有错误吧! class Student(object): def __init__(self, name, score): self.name = name self.score = score print_score(self): print('%s: %s' % (self.name, self.score)) bart = Student('Bart Simpson', 59) lisa = Student('Lisa Simpson', 87) bart.print_score() lisa.print_score()
A.
2行去掉最后的: B.
5行最前面加上def和一个空格,并且向左移动一个制表位 C.
9行括号内加Student D.
没有错误
A. 2行去掉最后的: B.
5行最前面加上def和一个空格,并且向左移动一个制表位 C.
9行括号内加Student D.
没有错误