Обновить u5/kindergarten_garden.py

This commit is contained in:
Arina Dohadailo 2026-10-13 12:57:59 +00:00
parent 8fb05588f2
commit 82e96a4d25

View File

@ -3,8 +3,7 @@ class NoSuchStudentException(Exception):
DEFAULT_STUDENTS = [ DEFAULT_STUDENTS = [
"Alena", "Boris", "Cyril", "Daniel", "Eva", "František", "Alena", "Boris", "Cyril", "Daniel", "Eva", "František",
"Gitka", "Helena", "Ivana", "Jozef", "Karol", "Ladislav", "Gitka", "Helena", "Ivana", "Jozef", "Karol", "Ladislav",]
]
PLANTS = {"G": "Trava", "C": "Datelina", "R": "Redkovky", "V": "Fialky"} PLANTS = {"G": "Trava", "C": "Datelina", "R": "Redkovky", "V": "Fialky"}
class Garden(): class Garden():
@ -22,4 +21,4 @@ class Garden():
raise NoSuchStudentException(f"Student {student} does not exist") raise NoSuchStudentException(f"Student {student} does not exist")
start = self.students.index(student) * 2 start = self.students.index(student) * 2
return [PLANTS[code] for row in self.rows for code in row[start:start + 2]] return [PLANTS[code] for row in self.rows for code in row[start:start + 2]]