报错了,请大神们帮我看看哪里错了呗!
class Person: def __init__(self,name,gender):#2 self.name=name self.gender=gender class Student(Person): def __init__(self,name,gender,score):#2+1 super(Student, self).__init__(name,gender) self.score=score class Teacher(Person): def __init__(self,name,gender,subject):#2+1 super(Teacher, self).__init__(name, gender) self.subject=subject class SkillMixin: def __init__(self,skill):#1 self.skill=skill class BasketballMixin(SkillMixin): def __init__(self,skill,basketball):#1+1 super(BasketballMixin, self).__init__(skill) self.basketball=basketball class FootballMixin(SkillMixin): def __init__(self,skill,football):#1+1 super(FootballMixin, self).__init__(skill) self.football=football class BasStudent(Student,BasketballMixin): def __init__(self,name,gender,score,skill,basketball):#3+2 super(BasStudent, self).__init__(name,gender,score) super(BasStudent, self).__init__(skill,basketball) print("我叫 %s,我会打%s "%(self.name,self.basketball)) class FootballTeacher(Teacher,FootballMixin): def __init__(self,name,gender,subject,skill,football): super(FootballTeacher, self).__init__(name,gender,subject) super(FootballTeacher, self).__init__(skill,football) print("我叫 %s,我会打%s "%(self.name,self.football)) a=Student('jiji','male',93) b=Teacher('kiki','female','English') c=BasketballMixin('skill','篮球') d=FootballMixin('ski','足球') BasStudent(a.name,a.gender,a.score,c.skill,c.basketball) FootballTeacher(b.name,b.gender,b.subject,d.skill,d.football)
Traceback (most recent call last):
File "/Users/lihui/IdeaProjects/laern/Python j进阶/3章 类的继承.py", line 278, in <module>
BasStudent(a.name,a.gender,a.score,c.skill,c.basketball)
File "/Users/lihui/IdeaProjects/laern/Python j进阶/3章 类的继承.py", line 266, in __init__
super(BasStudent, self).__init__(skill,basketball)
TypeError: __init__() missing 1 required positional argument: 'score'