Python 36 Question Attempt Error Message Codes Class Employee Object Def Init Self Name Sa Q37020789

Python 3.6 Question:

Using Inheritance Consider the following (base) class class Employee(object): def init_(self, name, salary): self._name name

My attempt:

class Employee (object): def init (self, name, salary): self._name name self .-salary = salary def get_name(self): return sel

Error Message:

-- Test 2---- Expected Output: Defined Worker class Test Result: Correct! Input: bob Employee( Bob, 58e) Test 3- Expected O

Codes:

class Employee(object):

def __init__(self, name, salary):

self._name = name
self._salary = salary

def get_name(self):

return self._name

def wage(self):

return self._salary / 26

class Worker(Employee):

def __init__(self, name, salary, manager):
  
super(Worker, self).__init__(name, salary)
self._manager = manager

def get_manager(self):
  
return self._manager.get_name()

class Executive(Employee):

def __init__(self, name, salary, bonus):

super(Executive, self).__init__(name, salary)
self._bonus =

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.