In python, complete the following code snippet to show how subclass needs to set some additional instance variable (i.e. employee_number) on top of the name instance variable inherited from its parent class:
class Employee(object):
def __init__(self, name):
self.name = name
class SpecialEmployee(Employee):
def __init__(self, name, employee_number): [...]
self.employee_number = employee_number
Answer
Employee.__init__(self, name)
Question
In python, complete the following code snippet to show how subclass needs to set some additional instance variable (i.e. employee_number) on top of the name instance variable inherited from its parent class:
class Employee(object):
def __init__(self, name):
self.name = name
class SpecialEmployee(Employee):
def __init__(self, name, employee_number): [...]
self.employee_number = employee_number
Answer
?
Question
In python, complete the following code snippet to show how subclass needs to set some additional instance variable (i.e. employee_number) on top of the name instance variable inherited from its parent class:
class Employee(object):
def __init__(self, name):
self.name = name
class SpecialEmployee(Employee):
def __init__(self, name, employee_number): [...]
self.employee_number = employee_number
Answer
Employee.__init__(self, name)
If you want to change selection, open document below and click on "Move attachment"
pdf
owner: kkhosravi - (no access) - PYTHON_DATA_STRUCTURES_AND_ALGORITHMS.pdf, p44
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised on
scheduled repetition
scheduled repetition interval
last repetition or drill
Details
No repetitions
Discussion
Do you want to join discussion? Click here to log in or create user.