This Looks Like a Job For... (Works but incorrect output)


This is the output I am getting:

"bound method PartTimeEmployee.full_time_wage of
PartTimeEmployee object at 0x7f847c123250

^ there are '<' and '>' put in the output... can't put them down here. It's is not showing when I put up this post.

I expected the wage printed out at $20.00 per hour! (That is, for 10 hours, the result should be 200.00.)

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

print milton.full_time_wage


full_time_wage is a method call, add parentheses to call the method, between the parentheses supply the argument


Thank you. It worked.


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