przyrost1

poprawione __str__ w plant i soil
This commit is contained in:
Dominik Małyszka 2020-04-07 18:28:04 +00:00
parent 3ddb999e3a
commit 97be779791
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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):