-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPConceptsWIP.py
More file actions
25 lines (21 loc) · 796 Bytes
/
OOPConceptsWIP.py
File metadata and controls
25 lines (21 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 * 12
# Add your code below!
# PartTimeEmployee extends Employee
# Employee is parent class and PartTimeEmployee is child class
# super is Employee and it makes sense that full_time_wage is
# calling super for calculate_wage
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)
obj = PartTimeEmployee("Milton")
#print(a_test.calculate_wage(10))
print(obj.full_time_wage(10))