This looks like a job for


#1


https://www.codecademy.com/courses/python-intermediate-en-WL8e4/2/4?curriculum_id=4f89dab3d788890003000096#

What's wrong with my code?
I tried figuring out, but everything seems to be right.
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

# Add your code below!
class PartTimeEmployee(Employee):
    def calculate_wage(self, hours):
        self.hours = hours
        print hours * 12.00
        return hours * 12.00
    def full_time_wage(self,hours):
        return super((PartTimeEmployee, self).calculate_wage(hours))
milton = PartTimeEmployee("aa")
print milton.calculate_wage(10)


#2

I think you should remove the parenteses following the super in the superclass call (see the syntax example in the lesson-instructions), like so:

def full_time_wage(self,hours):
    return super(PartTimeEmployee, self).calculate_wage(hours)

And then you should type:

milton = PartTimeEmployee("aa")
print milton.full_time_wage(10)

since you want to call the full_time_wage method of PartTimeEmployee that then will call the calculate_wage of the parent (aka Employee).

Hope it helps!


#3

Thank you, it worked.


#4

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