+ 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

10th May 2022, 9:35 AM
Sator ArepođŸŒŸđŸŒŒ
Sator ArepođŸŒŸđŸŒŒ - avatar
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))
10th May 2022, 10:51 AM
SoloProg
SoloProg - avatar