Skip to content

Commit ed34ebf

Browse files
committed
update
1 parent 39ba1e1 commit ed34ebf

File tree

8 files changed

+349
-0
lines changed

8 files changed

+349
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

Python tutorial - 15 - Inheritance/.idea/Python tutorial - 15 - Inheritance.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python tutorial - 15 - Inheritance/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python tutorial - 15 - Inheritance/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python tutorial - 15 - Inheritance/.idea/workspace.xml

Lines changed: 300 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from pprint import pprint
2+
3+
class Person:
4+
def __init__(self, first_name, last_name):
5+
self.first_name = first_name
6+
self.last_name = last_name
7+
8+
def print_first_name(self):
9+
pprint("Nguyen")
10+
11+
class Employee(Person):
12+
def print_first_name(self):
13+
super().print_first_name()
14+
print(" is an employee")
15+
16+
def __init__(self, first_name, last_name, staff_id):
17+
super().__init__(first_name, last_name)
18+
self.staff_id = staff_id
19+
20+
if __name__ == "__main__":
21+
# aPerson = Person()
22+
# aPerson.print_first_name()
23+
anEmployee = Employee("Nguyen", "Duc Hoang", "12345")
24+
pprint(anEmployee.first_name)
25+
pprint(anEmployee.last_name)
26+
pprint(anEmployee.staff_id)
95.6 KB
Binary file not shown.
95.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)