This commit is contained in:
Vadym Afanasiev 2026-10-14 19:44:23 +00:00
parent 5b6b8a308d
commit acd7e3d806

View File

@ -8,10 +8,13 @@ class Garden:
self.row1 = rows[0] self.row1 = rows[0]
self.row2 = rows[1] self.row2 = rows[1]
self.students = [ if students is None:
"Alena", "Boris", "Cyril", "Daniel", "Eva", "František", self.students = [
"Gitka", "Helena", "Ivana", "Jozef", "Karol", "Ladislav" "Alena", "Boris", "Cyril", "Daniel", "Eva", "František",
] "Gitka", "Helena", "Ivana", "Jozef", "Karol", "Ladislav"
]
else:
self.students = sorted(students)
self.plant_names = { self.plant_names = {
"G": "Tráva", "G": "Tráva",
@ -21,6 +24,9 @@ class Garden:
} }
def plants(self, student): def plants(self, student):
if student in self.students:
raise NoSuchStudentException()
index = self.students.index(student) index = self.students.index(student)
pos = index * 2 pos = index * 2