This looks like a job for.... please please help


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")


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:

print milton.full_time_wage(10)


tried it... don't works


Just noticed the error.

You wrote calcuate instead of calculate inside

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.