14 This Looks like a job for…


#1

In this exercise, I think I get the correct answer, but it always shows the warning "
Did you create an instance of the PartTimeEmployee class called milton?" I think I have already did this.
I post all my code here:

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

#2

x is not the expected variable name. milton is.


#3

Tank you for your answer. I follow your advice and get the right result. Tanks for the help


#4

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