Factory_Method/factories.py
def factory_call(self, requested_car):
        '''
        Returns the object of the desired car.
        '''

        car_brands = {
            'Honda' : Honda(),
            'Nissan': Nissan(),
            'Suzuki': Suzuki(),
            'Toyota': Toyota()
        }

        try:
            return car_brands[requested_car]
        except KeyError as err:
            raise ValueError("The requested car : %s is not found in the factory!"%(requested_car))

        Returns the object of the desired car.
        
Returns the object of the desired car.
Returns the object of the desired car .
def factory_call(self, requested_car):
        car_brands = {
            'Honda' : Honda(),
            'Nissan': Nissan(),
            'Suzuki': Suzuki(),
            'Toyota': Toyota()
        }
        try:
            return car_brands[requested_car]
        except KeyError as err:
            raise ValueError("The requested car : %s is not found in the factory!"%(requested_car))
def factory_call ( self , requested_car ) : car_brands = { 'Honda' : Honda ( ) , 'Nissan' : Nissan ( ) , 'Suzuki' : Suzuki ( ) , 'Toyota' : Toyota ( ) } try : return car_brands [ requested_car ] except KeyError as err : raise ValueError ( "The requested car : %s is not found in the factory!" % ( requested_car ) )
Returns the object of the desired car.
Returns the object of the desired car .
'''
        Returns the object of the desired car.
        '''
self
requested_car