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(1) milton=PartTimeEmployee("rajat") print milton.full_time_wage(10)
"""please help me in correcting this code.."""
return super(PartTimeEmployee, self).calculate_wage(1)
why do you give calculate_wage an argument value of
then the argument you supply here:
doesn't matter (while it should matter), use the method parameter
hours instead of
1 when calling parent class method with super
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.