text: import time
  from enum import Enum
  PizzaProgress = Enum('PizzaProgress', 'queued preparation baking ready')
  PizzaDough = Enum('PizzaDough', 'thin thick')
  PizzaSauce = Enum('PizzaSauce', 'tomato creme_fraiche')
  PizzaTopping = Enum('PizzaTopping', 'mozzarella double_mozzarella bacon ham mushrooms red_onion oregano')
  STEP_DELAY = 3
  
  
  class Pizza:
      def __init__(self, name):
          self.name = name
          self.dough = None
          self.sauce = None
          self.topping = []
  
      def __str__(self):
          return self.name
  
      def prepare_dough(self, dough):
          self.dough = dough
          print('preparing the {}dough of your {}...'.format(self.dough.name, self))
          time.sleep(STEP_DELAY)
          print('done with the {} dough'.format(self.dough.name))
  
  
  class MargaritaBuilder:
      def __init__(self):
          self.pizza = Pizza('margarita')
          self.progress = PizzaProgress.queued
          self.baking_time = 5
  
      def prepare_dough(self):
          self.progress = PizzaProgress.preparation
          self.pizza.prepare_dough(PizzaDough.thin)
  
      def add_sauce(self):
          print('adding the tomato sauce to your margarita---')
          self.pizza.sauce = PizzaSauce.tomato
          time.sleep(STEP_DELAY)
          print('done with the tomato sauce')
  
      def add_topping(self):
          print('add the topping (double mozzarella oregano) to your margarita')
          self.pizza.topping.append([i for i in (PizzaTopping.double_mozzarella,PizzaTopping.oregano)])
          time.sleep(STEP_DELAY)
          print('done with the topping (double mozzarella oregano)')
  
  
      def bake(self):
          self.progress = PizzaProgress.baking
          print('baking your margarita for {} seconds'.format(self.baking_time))
          time.sleep(self.baking_time)
          self.progress = PizzaProgress.ready
          print('your margarita is ready')
  
  class CreanyBaconBuilder:
      def __init__(self):
          self.pizza = Pizza('creamy bacon')
          self.progress = PizzaProgress.queued
          self.baking_time = 7 
  
      def prepare_dough(self):
          self.progress = PizzaProgress.preparation
          self.pizza.prepare_dough(PizzaDough.thin)
  
      def add_sauce(self):
          print('adding the tomato sauce to your margarita---')
          self.pizza.sauce = PizzaSauce.tomato
          time.sleep(STEP_DELAY)
          print('done with the tomato sauce')
  
      def add_topping(self):
          print('add the topping (double mozzarella oregano) to your margarita')
          self.pizza.topping.append([i for i in (PizzaTopping.double_mozzarella,PizzaTopping.oregano)])
          time.sleep(STEP_DELAY)
          print('done with the topping (double mozzarella oregano)')
  
  
      def bake(self):
          self.progress = PizzaProgress.baking
          print('baking your margarita for {} seconds'.format(self.baking_time))
          time.sleep(self.baking_time)
          self.progress = PizzaProgress.ready
          print('your creamy bacon is ready')
  
  
  class Waiter:
      def __init__(self):
          self.builder = None
  
      def construct_pizza(self,builder):
          self.builder = builder(step() for step in(builder.prepare_dough,builder.add_sauce,builder.add_topping,builder.bake))
  
      @property
      def pizza(self):
          return self.builder.pizza  
  
  
  
  def main():
      # builders = dict(m = MargaritaBuilder,c= CreanyBaconBuilder)
      waiter = Waiter()
      waiter.construct_pizza(builder)
      pizza = waiter.pizza
      print()
      print('enjoy your {}!'.format(pizza))
  
  if __name__ == "__main__":
      main()
  