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

This commit is contained in:
Arina Dohadailo 2026-10-13 12:36:14 +00:00
parent 11ca323fe5
commit 1829a679e2

View File

@ -1,22 +1,22 @@
class NoSuchStudentException(Exception):
"""Žiak nie je v zozname."""
DEFAULT_STUDENTS = [
DEFAULT_STUDENTS = [
"Alena", "Boris", "Cyril", "Daniel", "Eva", "František",
"Gitka", "Helena", "Ivana", "Jozef", "Karol", "Ladislav",
]
class Garden():
def __init__(self, diagram: str):
self.diagram: str = diagram
self.rows: str = diagram.splitlines()
self.diagram: str = diagram
self.rows: str = diagram.splitlines()
def add_rows(self,row):
if isinstance(row,str):
raise ValueError("Row has to be string")
self.rows.append(row)
garden = Garden("VVCG\nWRC")
garden = Garden("VVCG\nVVRC")
print([item[1:3] for item in garden.rows])
garden.rows.append(Garden("s\ns"))
print(garden.rows)