input: Write a function to extract and print the latest stock prices from specific websites for given stock symbols. The function should take a list of stock symbols as input and return the current prices of those stocks. If the stock symbol is invalid or the price cannot be found, the function should print an error message for that stock. The function should be able to handle any number of stock symbols provided in the input list.
  def get_stock_price(stocks):
      import requests
      from bs4 import BeautifulSoup
      
      def fetch_price(stock):
          url = f"https://finance.yahoo.com/quote/{stock}"
          response = requests.get(url)
          if response.status_code == 200:
              soup = BeautifulSoup(response.text, 'html.parser')
              price = soup.find('div', {'class': 'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
              return price
          else:
              return "Error: Price not found"
  
      for stock in stocks:
          price = fetch_price(stock)
          print(f'The price of {stock} is {price}.')
  
  # Test cases
  get_stock_price(["AAPL", "MSFT", "FB", "GOOG"])
  get_stock_price(["TSLA", "AMZN", "NVDA"])
  get_stock_price(["INVALID", "FB"])
  get_stock_price(["AMZN"])
  get_stock_price([])
  
  # Expected output for the first test case:
  # The price of AAPL is $XXX.XX.
  # The price of MSFT is $XXX.XX.
  # The price of FB is $XXX.XX.
  # The price of GOOG is $XXX.XX.
output: def get_stock_price(stocks):
      import requests
      from bs4 import BeautifulSoup
      
      def fetch_price(stock):
          url = f"https://finance.yahoo.com/quote/{stock}"
          response = requests.get(url)
          if response.status_code == 200:
              soup = BeautifulSoup(response.text, 'html.parser')
              price_tag = soup.find('fin-streamer', {'data-field': 'regularMarketPrice'})
              if price_tag:
                  return price_tag.text
              else:
                  return "Error: Price not found"
          else:
              return "Error: Price not found"
  
      for stock in stocks:
          price = fetch_price(stock)
          print(f'The price of {stock} is {price}.')