class Person(object):
def init(self,name,sex,age):
self.name=name
self.sex=sex
self.age=age
class Student(Person):
def init(self,name,sex,age,score):
super().init(name,sex,age)
self.score=score
class Teacher(Person):
def init(self,name,sex,age,subject):
super().init(name,sex,age)
self.subject=subject
class School(Student,Teacher):
def init(self,name,sex,age,subject,score,myclass):
super().init(name,sex,age,subject,score)
self.myclass=myclass
p1=School(‘xiaowang’,‘男’,20,‘体育’,‘90’,‘e’)
C:\Users\adi\PycharmProjects\untitled1\venv\Scripts\python.exe C:/Users/adi/PycharmProjects/untitled1/normal.py
Traceback (most recent call last):
File “C:/Users/adi/PycharmProjects/untitled1/normal.py”, line 22, in
p1=School(‘xiaowang’,‘男’,20,‘体育’,‘90’,‘e’)
File “C:/Users/adi/PycharmProjects/untitled1/normal.py”, line 19, in init
super().init(name,sex,age,subject,score)
TypeError: init() takes 5 positional arguments but 6 were given