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


#1



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?
#2

Change it to:

print milton.full_time_wage(10)

#3

tried it... don't works


#4

Just noticed the error.

You wrote calcuate instead of calculate inside

return super (PartTimeEmployee,self).calculate_wage(hours)

#5

super stupid mistake. thank you so much for your help.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.