code: def average_price(quantity_1, price_1, quantity_2, price_2):
      
      return (quantity_1 * price_1 + quantity_2 * price_2) / \
              (quantity_1 + quantity_2)
docs: Calculates the average price between two asset states.