Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetfyx committed Feb 17, 2024
1 parent b551422 commit c728058
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions python/src/dish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"""



2 changes: 1 addition & 1 deletion python/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

if __name__ == "__main__":
dish = Dish("Борщ", "Суп", 500)
print(dish.info)
print(dish.info)

0 comments on commit c728058

Please sign in to comment.