From 5471ae89444d1068085be4ec8b546ff0567dc25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 30 Dec 2018 00:19:06 +0100 Subject: [PATCH] Enheritance --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 09980c4..9e5ebe3 100644 --- a/README.md +++ b/README.md @@ -599,6 +599,19 @@ class : 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