forked from gr1d99/Pizza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
27 lines (20 loc) · 810 Bytes
/
main.py
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
26
class Employee(object):
def __init__(self, name, salary=0):
self.name = name
self.salary = salary
def give_raise(self, percent):
new_salary = self.salary * percent
self.salary += new_salary
return 'New Salary is ', self.salary
def work(self):
print("%(name)s does stuff" % dict(name=self.name))
def __str__(self):
return "<Employee: %(name)s, Salary: %(salary)s>" % dict(name=self.name, salary=self.salary)
def __repr__(self):
return "<Employee: %(name)s, Salary: %(salary)s>" % dict(name=self.name, salary=self.salary)
class Chef(Employee):
def __init__(self, name, salary=5000):
self.name = name
self.salary = salary
def work(self):
print("%(name)s makes food" % dict(name=self.name))