Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for 3 Chefs by U.V
class AbstractCook:
def __init__(self, dname=None,fname=None ):
self.drink = 0
self.food = 0
self.dname = dname
self.fname = fname
def add_food(self, amm, price):
self.food += amm * price
def add_drink(self, amm, price):
self.drink += amm * price
def total(self):
return f'{self.fname}: {self.food}, {self.dname}: {self.drink}, Total: {self.drink + self.food}'
class JapaneseCook(AbstractCook):
def __init__(self):
super().__init__(fname='Sushi',dname='Tea')
class RussianCook(AbstractCook):
def __init__(self):
super().__init__(fname='Dumplings',dname='Compote')
class ItalianCook(AbstractCook):
def __init__(self):
super().__init__(fname='Pizza',dname='Juice')
Aug. 30, 2022
Comments: