Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def __init__(self):
- self.cust = Customer() # Создаем и встраиваем customer and employee
- self.empl = Employee()
- def order(self, foodName): # начинаем имитацию заказа блюда
- self.cust.placeOrder(foodName,self.empl)
- def result(self): # узнаем у клиента название блюда
- self.cust.printFood()
- def __init__(self):
- self.food = None
- def placeOrder(self, foodName, employee):
- self.food = employee.takeOrder(foodName)
- def printFood(self):
- print(Food(self.food))
- def takeOrder(self, foodName): # возвращаем блюдо с требуемым названием
- return Food(foodName)
- def __init__(self, name): # сохраняем название блюда
- self.name = name
- x = Lunch()
- x.order('burritos')
- x.result()
Add Comment
Please, Sign In to add comment