摘要: 类方法、实例方法和静态方法的区别。 创建一个 Student 类,用于管理学生的信息和计算成绩相关的数据。 class Student: # 类属性,记录学生的总数 total_students = 0 def __init__(self, name, score): # 实例属性,学生的姓名 se 阅读全文
posted @ 2025-04-21 21:09 Budcs 阅读(40) 评论(0) 推荐(0)