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 def full_time_wage(self,hours): return super(PartTimeEmployee,self).calculate_wage(hours) milton = PartTimeEmployee("sunny") print milton.full_time_wage(hours)
Please post a link to the exercise. Thanks.
Is there some number of hours that you need to pass?
No, its not given in the exercise.
If that line is needed, then invent some number of hours, say,
hours variable is undefined in that scope.
You should see his wage printed out at $20.00 per hour! (That is, for 10 hours, the result should be 200.00.)
What should I put there instead of 'hours', because it checks for many cases.
Use any number.
But then it says,your code fails for milton.full_time_wage(0)
I got it, Thanks for help
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.