13/18 need help? heres me answer mates


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):
return hours * 12.00


What you are doing is called Overrriding, what this means is that you can create a function with the same namespace as another function and when that name is called the new function will be called.

It also begs to mention that Overridning at the class level is only in the class scope, you CAN override any function at any scope and if you do it unintentionally you will cause bugs.

On to your issue.

class PartTimeEmployee(Employee):
    def calculate_wage(self, hours)
        return hours * 12.00

Now when you call this class you HAVE to pass all the arguments the BaseClass needs.


Rob = PartTimeEmployee('Rob')
b = Rob.calculate_wage(40)



Please re-edit your Post

  • select all of your code
  • then =click= on the </>-symbol of this editor.

Your code will be put in a pre-code modus
and you are able to use the rigth indentations...!!!


thanks mate i didnt know that