Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Product:
- def __init__(self, name, price):
- self.__name = name
- self.__price = price
- @property
- def name(self):
- return self.__name
- @property
- def price(self):
- return self.__price
- from project.product import Product
- class Beverage(Product):
- def __init__(self, name, price, milliliters):
- super().__init__(self, name, price)
- self.__milliliters = milliliters
- from project.product import Product
- class Food(Product):
- def __init__(self, name, price, grams):
- super().__init__(self, name, price)
- self.__grams = grams
- import
- class HotBeverage(Beverage):
- def __init__(self, name, price, milliliters):
- super().__init__(self, name, price, milliliters)
- import
- class ColdBeverage(Beverage):
- def __init__(self, name, price, milliliters):
- super().__init__(self, name, price, milliliters)
- import
- class Coffee(HotBeverage):
- MILLILITERS = 50
- PRICE = 3.50
- def __init__(def __init__(self, name, caffeine):
- super().__init__(self, name, self.PRICE, self.MILLILITERS, caffeine):
- self.__caffeine = caffeine
- class Starter(Food):
- ........
- class MainDish(Food):
- ........
- class Dessert(Food):
- ........
- class Salmon(MainDish):
- GRAMS = 22
- ......
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement