Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for 3 Chefs by fed.kz
class Cook:
def __init__(self, food='', drink=''):
self.fprice, self.dprice = 0, 0
self.food, self.drink = food, drink
def add_food(self, amount, price):
self.fprice += amount * price
def add_drink(self, amount, price):
self.dprice += amount * price
def total(self):
return f"{self.food}: {self.fprice}, {self.drink}: {self.dprice}, Total: {self.fprice + self.dprice}"
class JapaneseCook(Cook):
def __init__(self): super().__init__('Sushi', 'Tea')
class RussianCook(Cook):
def __init__(self): super().__init__('Dumplings', 'Compote')
class ItalianCook(Cook):
def __init__(self): super().__init__('Pizza', 'Juice')
Oct. 26, 2018