-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrainingLesson.py
60 lines (45 loc) · 1.39 KB
/
TrainingLesson.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
53
54
55
56
57
58
59
class TrainingLesson:
Lesson_id = 1
def __init__(self, name, time, capacity):
self.__lesson_id = TrainingLesson.Lesson_id
TrainingLesson.Lesson_id += 1
self.__name = name
self.__time = time
self.__capacity = capacity
@property
def lesson_id(self):
return self.__lesson_id
@lesson_id.setter
def lesson_id(self, nwe_lesson_id):
self.lesson_id = nwe_lesson_id
@property
def name(self):
return self.__name
@name.setter
def name(self, nwe_name):
self.__name = nwe_name
@property
def time(self):
return self.__time
@time.setter
def time(self, time):
self.__time = time
@property
def capacity(self):
return self.__capacity
@capacity.setter
def capacity(self, capacity):
self.__capacity = capacity
@property
def enrolled_customer(self):
return self.__enrolled_customers
@enrolled_customer.setter
def enrolled_customer(self, new_enrolled_customer):
self.__enrolled_customer = new_enrolled_customer
def display_details(self):
print(f"Lesson: {self.name}")
print(f"Time: {self.time}")
print(f"Capacity: {len(self.enrolled_customers)}/{self.capacity}")
print("Enrolled Customers:")
for customer in self.enrolled_customers:
print(f"- {customer.name()}")