class Blomst: def __init__(self, art, hoyde) -> None: self._art: str = art self._hoyde: int = hoyde self._status = True self._dager_siden_vanning = 0 def hent_status(self): return self._status def skriv_ut_info(self): string = "Art: " + self._art string += "\nHoyde: " + str(self._hoyde) if self._status: string += "\nBlomsten har det: Bra" else: string += "\nBlomsten har det: D?rlig" string += "\nDager siden vanning: " + str(self._dager_siden_sanning) print(string) def neste_dag(self): self._dager_siden_vanning += 1 if self._dager_siden_vanning > 3: self._status = False if self._status: self._hoyde += 1 def vann(self): if self._dager_siden_vanning < 3: self._status = False else: self._status = True self._dager_siden_vanning = 0