14/19 This looks like a job for


#1



HELLO!! PLEASE HELP

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


This is the error message I'm getting:
Traceback (most recent call last):
File "python", line 20, in
TypeError: full_time_wage() takes exactly 2 arguments (1 given)

HERE IS MY CODE

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


#2

milton.full_time_wage() takes two arguments, self and hours. When you run
print milton.full_time_wage() it has the first argument of self, but it is missing the hours argument. Try running that print statement but pass some hours to the full_time_wage() method by including them between the parenthesis.


#3

Did it change after giving hours? I'm still getting error. What should exactly should be there within the paranthesis? I used print milton.full_time_wage(10) .
But getting error


#4

Your print statement is correct, you should have 10 between the parentheses. I think what is throwing the error is having the extra self in return super(PartTimeEmployee, self).calculate_wage(self, hours)

Try removing self from .calculate_wage(self, hours)


#5

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