22 lines
630 B
Python
22 lines
630 B
Python
class NoSuchStudentException(Exception):
|
|
"""Žiak nie je v zozname."""
|
|
|
|
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()
|
|
|
|
def add_rows(self,row):
|
|
if isinstance(row,str):
|
|
raise ValueError("Row has to be string")
|
|
self.rows.append(row)
|
|
|
|
garden = Garden("VVCG\nWRC")
|
|
print([item[1:3] for item in garden.rows])
|
|
garden.rows.append(Garden("s\ns"))
|
|
print(garden.rows) |