Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for 3 Chefs by OrginalS
class AbstractCook:
def __init__(self):
self.food = 0
self.drink = 0
def add_food(self, amount, price):
self.food += amount * price
def add_drink(self, amount, price):
self.drink += amount * price
def total(self):
return f"{self.dish}: {self.food}, {self.beverage}: {self.drink}, Total: {self.drink + self.food}"
class JapaneseCook(AbstractCook):
def __init__(self):
super().__init__()
self.dish = "Sushi"
self.beverage = "Tea"
class RussianCook(AbstractCook):
def __init__(self):
super().__init__()
self.dish = "Dumplings"
self.beverage = "Compote"
class ItalianCook(AbstractCook):
def __init__(self):
super().__init__()
self.dish = "Pizza"
self.beverage = "Juice"
Sept. 14, 2019
Comments: