diff --git a/plant.py b/plant.py index 4881849..e167355 100644 --- a/plant.py +++ b/plant.py @@ -16,7 +16,7 @@ class Plant: #to sie drukuje jak zapytamy o stworzony obiekt def __str__(self): - return 'Plant: %s , Soil: %s , Status: %s' % (self._name, self._soil, self._collect()) + return f'Plant: {self._name}, Soil: {self._soil}, Status: {self.collect()}' #metoda abstrakcyjna, kazda roslina ma inny czas rosniecia wiec pass @abstractmethod diff --git a/soil.py b/soil.py index 73f154c..c970010 100644 --- a/soil.py +++ b/soil.py @@ -15,7 +15,7 @@ class Soil: self.plant_remove() def __str__(self): - return '(%s, %s), Plant: %s' % (self._x, self._y, self.have_plant()) + return f'{self._x}, {self._y}), Plant: {self._plant}' # współrzędne pola def get_coordinates(self):