14.This Looks Like a Job For


#1



why does this code not work
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
        return hours * 12.00
        def full_time_wage(self, hours):
            self.hours = hours
            return super(PartTimeEmployee, self).calculate_wage(hours)
milton = PartTimeEmployee(10)
print milton.full_time_wage()


#2

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).calculate_wage(hours)


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

Look at the attributes which you have to pass to the init and to the full_time_wage methods. You are passing as a name 10 and then you are not giving any argument to the second method. There is a solution to your problem. Enjoy!


#3

never mind figured it out :slight_smile:


#4

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