diff --git a/u5/kindergarten_garden.py b/u5/kindergarten_garden.py index 80890dc..b8da806 100644 --- a/u5/kindergarten_garden.py +++ b/u5/kindergarten_garden.py @@ -1,32 +1,35 @@ +```python class NoSuchStudentException(Exception): pass class Garden: DEFAULT_STUDENTS = [ - "Alice", "Bob", "Charlie", "David", - "Eve", "Fred", "Ginny", "Harriet", - "Ileana", "Joseph", "Kincaid", "Larry" + "Alena", "Boris", "Cyril", "Daniel", + "Eva", "František", "Gitka", "Helena", + "Ivana", "Jozef", "Karol", "Ladislav" ] PLANT_MAP = { - 'G': 'tráva', - 'C': 'ďatelina', - 'R': 'reďkovky', - 'V': 'fialky' + 'G': 'Tráva', + 'C': 'Ďatelina', + 'R': 'Reďkovky', + 'V': 'Fialky' } def __init__(self, diagram, students=None): if students is None: - self.students = sorted(self.DEFAULT_STUDENTS) + self.students = self.DEFAULT_STUDENTS.copy() else: self.students = sorted(students) - + self.r = diagram.splitlines() def plants(self, student): if student not in self.students: - raise NoSuchStudentException(f"Student '{student}' is not assigned a plot.") + raise NoSuchStudentException( + f"Student '{student}' is not assigned a plot." + ) i = self.students.index(student) c1 = i * 2 @@ -39,4 +42,5 @@ class Garden: self.r[1][c2] ] - return [self.PLANT_MAP[code] for code in student_plants] \ No newline at end of file + return [self.PLANT_MAP[code] for code in student_plants] +```