第31838题 单选题
运行以下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)
A

102 102 102

B

100 101 101

C

100 100 100

D

102 101 101

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析