-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsp.py
52 lines (42 loc) · 1.5 KB
/
lsp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class University:
def __init__(self, name: str = None):
self.name = name
self.profile = {}
def add_profile(self, **kwargs):
self.profile = {}
for elem in kwargs:
if elem not in self.profile:
self.profile[elem] = kwargs[elem]
else:
print(f'key {elem} is already in the profile')
class Group(University):
def __init__(self, students: list, name: str = None):
super().__init__(name=name)
self.students = students
def add_profile(self, **kwargs):
self.profile = {}
for elem in kwargs:
if elem not in self.profile:
self.profile[elem] = kwargs[elem]
else:
print(f'key {elem} is already in the profile')
class Student(University):
def __init__(self, name: str = None):
super().__init__(name=name)
def add_profile(self, **kwargs):
self.profile = {}
for elem in kwargs:
if elem not in self.profile:
self.profile[elem] = kwargs[elem]
else:
print(f'key {elem} is already in the profile')
class Teacher(University):
def __init__(self, name: str = None):
super().__init__(name=name)
def add_profile(self, **kwargs):
self.profile = {}
for elem in kwargs:
if elem not in self.profile:
self.profile[elem] = kwargs[elem]
else:
print(f'key {elem} is already in the profile')