运行以下Python代码,最终的输出结果是?
class Student:
total = 100 # 类属性,代表年级总人数
def __init__(self, name):
self.name = name
self.total += 1 # 实例操作total属性
s1 = Student("小明")
s2 = Student("小红")
print(Student.total, s1.total, s2.total)
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析