求帮找代码异常打印输出
# Enter a code class Person(object): def __init__(self, name, gender): self.name = name self.gender = gender def who(self): return 'I am a Person, my name is %s' % self.name class Student(Person): def __init__(self, name, gender, score): super(Student, self).__init__(name, gender) self.score = score def who(self): return 'I am a Student, my score is %s' % self.score class Teacher(Person): def __init__(self, name, gender, course): super(Teacher, self).__init__(name, gender) self.course = course def who(self): return 'I am a Teacher,teching %s'%self.course class SkillMixin(object): def __init__(self): pass def get_skill(self): print('I hava a skill') class BasketballSkillMixin(SkillMixin): def __init__(self): super(BasketballSkillMixin,self).__init__() self.skill='basketball' def get_skill(self): print('I hava a %s skill'%self.skill) class FootballSkillMixin(SkillMixin): def __init__(self): super(FootballSkillMixin,self).__init__() self.skill='football' def get_skill(self): print('I hava a %s skill'%self.skill) class MyBasketStudent(BasketballSkillMixin,Student): def __init__(self,name,gender,score): Student.__init__(self,name,gender,score) BasketballSkillMixin.__init__(self) class MyFootballTeacher(FootballSkillMixin,Teacher): def __init__(self,name,gender,course): Teacher.__init__(self,name,gender,course) FootballSkillMixin.__init__(self) a=MyBasketStudent('xiaoming','man',98) print(a.who()) print(a.get_skill()) # b=MyFootballTeacher('lixing','man','physical') # print(b.who()) # print(b.get_skill())
疑问:为啥最后一行多打印了一个None?