This looks like a Job For


#1



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


Hi Guys,

I am having an issue with my code and I cannot figure it out for love nor money. The error message in the console is as follows:

Traceback (most recent call last):
File "python", line 19, in
File "python", line 14, in init
TypeError: can't multiply sequence by non-int of type 'float'

And I have no idea why, my code is below.

Any help would be fantastic!!

Thank you in advance.
Sam


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


#2

i don't see anywhere in the instructions, that PartTimeEmployee needs an __init__() method?


#3

That fixed it. Thank you.


#4

because you removed init from PartTimeEmployee, when creating an instance the parent class (Employee) init method is caleld instead.


#5

Hi, hobbitgill
Do you still remember how to fix it? thanks
I am meeting the same issue.


#6

given my answer solved his problem, you should be able to solve it as well using my answer? Otherwise, make a new topic please


#7