Добавили абстрактный класс Person и наследовали классы Студентов и Учителей.
This commit is contained in:
parent
0ef5202a0a
commit
85673af84f
1 changed files with 15 additions and 0 deletions
15
app.py
15
app.py
|
|
@ -1 +1,16 @@
|
|||
class Person:
|
||||
def __init__(self, name, age):
|
||||
self.name = name
|
||||
self.age = age
|
||||
|
||||
|
||||
class Student(Person):
|
||||
def __init__(self, name, age):
|
||||
super().__init__(name, age)
|
||||
|
||||
class Teacher(Person):
|
||||
def __init__(self, name, age):
|
||||
super().__init__(name, age)
|
||||
|
||||
|
||||
print("Привет!")
|
||||
Loading…
Add table
Add a link
Reference in a new issue