class Person(object):
def __init__(self,name):
self.name=name
def who(self):
return 'I am a Person,my name is %s'%self.name
class Student(Person):
def __init__(self,name,score):
super(Student,self).__init__(name)
self.score=score
def who(self):
return 'I am a Student,my name is %s'%self.name
class Teacher(Person):
def __init__(self,name,course):
super(Teacher,self).__init__(name)
self.course =course
def who(self):
return 'I am a Teacher,my name is %s'%self.name
class Work(Student,Teacher):
def __init__(self,name,score,course,timetable):
super(Work,self).__init__(name,score,course)
self.timetable=timetable
p = Person('Tim')
s = Student('Bob',12, )
t = Teacher('Alice', 'English')
w=Work('Herman',96,'english',22)
print(w.who())