What am I doing wrong?



Doesn't print his wage

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 PartTimeEmployee.calculate_wage(12.00)
    def full_time_wage(self , hours):
        return super(PartTimeEmployee , self).calculate_wage() 
milton = PartTimeEmployee("milton")
print milton.full_time_wage(10)

OUTPUT : Traceback (most recent call last):
File "python", line 18, in
File "python", line 16, in full_time_wage
TypeError: calculate_wage() takes exactly 2 arguments (1 given)


Remove this function that's in the child class PartTimeEmployee,

Your child class inherits from the Parent ClassEmployee meaning you don't need another calculate_wage function.:slight_smile:


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