我有这些课程.
Person是父类,Student是子类:
class Person(object):
def __init__(self, name):
self.name = name
class Student(Person):
def __init__(self, avr, name):
self.avr = avr
super(Student, self).__init__(self, name)
Run Code Online (Sandbox Code Playgroud)
当我尝试创建一个实例时,我收到此错误Student:
__init__() takes exactly 2 arguments (3 given)
Run Code Online (Sandbox Code Playgroud)
我的代码出了什么问题?