接着,我们分别把不同类型的who()函数结果打印出来:
p = Person('Tim', 'Male') s = Student('Bob', 'Male', 88) t = Teacher('Alice', 'Female', 'English')
运行结果:
I am a Person, my name is Tim I am a Student, my name is Bob I am a Teacher, my name is Alice
#
print(p.who()) 老师没写这一步操作