Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for 3 Chefs by tokiojapan55
class AbstractCook:
def __init__(self):
self.food_price = 0
self.drink_price = 0
def add_food(self, num, price):
self.food_price += num * price
def add_drink(self, num, price):
self.drink_price += num * price
def total(self):
return f'{self.food_name}: {self.food_price}, {self.drink_name}: {self.drink_price}, Total: {self.food_price + self.drink_price}'
class JapaneseCook(AbstractCook):
food_name = 'Sushi'
drink_name = 'Tea'
class RussianCook(AbstractCook):
food_name = 'Dumplings'
drink_name = 'Compote'
class ItalianCook(AbstractCook):
food_name = 'Pizza'
drink_name = 'Juice'
June 17, 2020
Comments: