+ 2
Parent/child class issue in the code
here's the code https://code.sololearn.com/czhSaIMv013d So it gives me no 'tell(self)' from the parent class on the output, only 'tell(self)' from the child class
1 Answer
+ 5
You forgot to add this code
super().tell()
inside the child functions
def tell(self):
You add it like this:
def tell(self):
super().tell()
print('Teacher {0} salary is: {1:d}'.format(self.name, self.salary))
def tell(self):
super().tell()
print('Marks: {0}'.format(self.marks))