diff --git a/python/src/dish.py b/python/src/dish.py index 9fd4a80..f96f29c 100644 --- a/python/src/dish.py +++ b/python/src/dish.py @@ -8,15 +8,15 @@ def __init__(self, name, vid, price): @property def name(self): return self.__name - + @property def vid(self): return self.__vid - + @property def price(self): return self.__price - + @name.setter def name(self, value): self.__name = value @@ -29,16 +29,13 @@ def vid(self, value): def price(self, value): self.check_price(value) self.__price = value - + def check_price(self, price): if price >= 5000 or price <= 0: raise ValueError("Это блюдо вам не по карману") - + @property def info(self): return f"""Цена: {self.price} Название: {self.name} Тип блюда: {self.vid}""" - - - \ No newline at end of file diff --git a/python/src/main.py b/python/src/main.py index d77184a..f4c6535 100644 --- a/python/src/main.py +++ b/python/src/main.py @@ -2,4 +2,4 @@ if __name__ == "__main__": dish = Dish("Борщ", "Суп", 500) - print(dish.info) \ No newline at end of file + print(dish.info)