Python子类Student继承Person时,空白处应填什么正确初始化子类实例?
在一个学校管理系统中,有基类Person表示人员,有属性name和age,子类Student继承自Person,并额外有属性student_id。现有如下代码:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Student(Person):
def __init__(self, name, age, student_id):
____
self.student_id = student_id
# 创建学生实例
student = Student("小明", 18, "001")
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析