That looks like a job for


#1

Can't understand whats wrong.

Error message:

Traceback (most recent call last):
File "python", line 24, in
AttributeError: 'tuple' object has no attribute 'full_time_wage'

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

milton = ("Milton", 1200)
print milton.full_time_wage

#2

>>> type(("Milton", 1200))
<type 'tuple'>

#3

Thanks! I'd frogotten to state the class. But now it's telling me that init takes 2 arguments and I gave it 3


#4

Then you'd need to give it one less, yes? Refer to your __init__ definition


#5

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