Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
AbstractCook solution in Clear category for 3 Chefs by flpo
class AbstractCook:
def __init__(self):
self.food_total_price = self.drink_total_price = 0
def add_food(self, food_amount, food_price):
self.food_total_price += food_amount * food_price
def add_drink(self, drink_amount, drink_price):
self.drink_total_price += drink_amount * drink_price
def total(self):
f, d = self.food_total_price, self.drink_total_price
return f'{self.food}: {f}, {self.drink}: {d}, Total: {f + d}'
class JapaneseCook(AbstractCook):
food, drink = 'Sushi', 'Tea'
class RussianCook(AbstractCook):
food, drink = 'Dumplings', 'Compote'
class ItalianCook(AbstractCook):
food, drink = 'Pizza', 'Juice'
June 8, 2018
Comments: