python2 :
Teacher(Person): (namegendercourse): (Teacher,).__init__(namegender) .course = course
python3:
Teacher(Person): (gendercourse): ().(.namegender) .course = course
#请参考Student类,编写Teacher类,老师拥有任教某个科目的属性。 class Students: def __init__(self, name, gender,score ): self.name = name self.gender = gender self.score = score class Taecher (Students): def __init__(self,name,gender,score,account): super().__init__(name,gender,score) self.account=account def get_info (self): return self.name,self.gender,self.score,self.account tt=Taecher("张三","女",90,"语文") print(tt.get_info())
😥...
😥...