This looks like a job for


#1



Can't get my code to work and couldn't find anything in the existing topics. Does anyone have an idea?


Here's the error message I'm getting:


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 __init__(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)


Any ideas?
Thanks,
Matt


#2

i don't see anywhere in the instructions that PartTimeEmployee should have an __init__() method?

It seems to cause the problem, since when you initialize the class here:

milton = PartTimeEmployee("Milton")

Milton is a string, which you multiply by 12 in the init method

Maybe revisit 13. override to see what needs to be done?


#3

Oh, yeah. True. I just left the previous code there...
Leaving the init() method is quite redundant. So I removed it and it worked.
Thank you, @stetim94!


#4