Lost on 14


#1



https://www.codecademy.com/en/courses/python-intermediate-en-WL8e4/2/4?curriculum_id=4f89dab3d788890003000096#


I am trying to complete exercise 14 and I am not fully understanding it. I followed the instructions, figured out how to return the super and I am getting a "Congratulations you finished" message.

But...

The result is not displaying 20* my arg, instead it displays this error:

"bound method PartTimeEmployee.full_time_wage of PartTimeEmployee object at 0x7fd5e693e390
None"


I could use some help identifying what is wrong and direction as to what the "def full_time_wage(self, hours):" actually does.


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)

milton = PartTimeEmployee(5)

print milton.full_time_wage


#2

milton = PartTimeEmployee(5)

call first your employee name
then calculate milton.full_time_wage(hours)


#3

Worked like a charm. Thank you

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



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("Jim")

print milton.full_time_wage(5)

#4

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