@@ -0,0 +1,871 @@
+class Pizza(object):%0A    def __init__(self):%0A        self._price = None%0A%0A    def get_price(self):%0A        return self._price%0A%0Aclass HamAndMushroomPizza(Pizza):%0A    def __init__(self):%0A        self._price = 8.5%0A%0Aclass DeluxePizza(Pizza):%0A    def __init__(self):%0A        self._price = 10.5%0A%0Aclass HawaiianPizza(Pizza):%0A    def __init__(self):%0A        self._price = 11.5%0A%0Aclass PizzaFactory(object):%0A    @staticmethod%0A    def create_pizza(pizza_type):%0A        if pizza_type == 'HamMushroom':%0A            return HamAndMushroomPizza()%0A        elif pizza_type == 'Deluxe':%0A            return DeluxePizza()%0A        elif pizza_type == 'Hawaiian':%0A            return HawaiianPizza()%0A%0Aif __name__ == '__main__':%0A    for pizza_type in ('HamMushroom', 'Deluxe', 'Hawaiian'):%0A          print('Price of %7B0%7D is %7B1%7D'.format(pizza_type, PizzaFactory.create_pizza(pizza_type).get_price())%0A

Add factory pattern