Browse Source

Enheritance

pull/9/head
Jure Šorn 6 years ago
parent
commit
5471ae8944
1 changed files with 13 additions and 0 deletions
  1. 13
      README.md

13
README.md

@ -599,6 +599,19 @@ class <name>:
self.a = a
```
### Inheritance
```python
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
class Employee(Person):
def __init__(self, name, age, staff_num):
super().__init__(name, age)
self.staff_num = staff_num
```
### Copy
```python
from copy import copy, deepcopy

Loading…
Cancel
Save