https://www.codecademy.com/en/courses/python-intermediate-en-WL8e4/2/4?curriculum_id=4f89dab3d788890003000096 class Employee(object): """Models real-life employees!""" def __init__(self, employee_name): self.employee_name = employee_name def calculate_wage(self, hours): self.hours = hours return hours * 20.00 class PartTimeEmployee(Employee): def calculate_wage(self, hours): self.hours = hours return hours*12.00 def full_time_wage(self, hours): return super (PartTimeEmployee,self).calcuate_wage(hours) milton = PartTimeEmployee("employee") milton.full_time_wage(10) print milton error- Traceback (most recent call last): File "python", line 17, in <module> File "python", line 14, in full_time_wage AttributeError: 'super' object has no attribute 'calcuate_wage'
Why separate form from function?
Change it to:
tried it... don't works
Just noticed the error.
calcuate instead of
return super (PartTimeEmployee,self).calculate_wage(hours)
super stupid mistake. thank you so much for your help.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.