Skip to content

Commit 5471ae8

Browse files
committed
Enheritance
1 parent 5a44f31 commit 5471ae8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,19 @@ class <name>:
599599
self.a = a
600600
```
601601

602+
### Inheritance
603+
```python
604+
class Person:
605+
def __init__(self, name, age):
606+
self.name = name
607+
self.age = age
608+
609+
class Employee(Person):
610+
def __init__(self, name, age, staff_num):
611+
super().__init__(name, age)
612+
self.staff_num = staff_num
613+
```
614+
602615
### Copy
603616
```python
604617
from copy import copy, deepcopy

0 commit comments

Comments
 (0)