input: Write a function to scrape the latest stock prices from Yahoo Finance for given stock tickers. The function should take a list of stock names (e.g., ["AAPL stocks", "MSFT stocks"]) as input and print the current stock price for each stock. If the stock price is not found, the function should print "Price not available." If the input list is empty, the function should not perform any action.
  import requests
  from bs4 import BeautifulSoup
  
  def get_stock_price(stocks):
      if not stocks:
          return
      for stock in stocks:
          url = f"https://finance.yahoo.com/quote/{stock}"
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          try:
              price = soup.find('div', {'class': 'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
          except AttributeError:
              price = "Price not available"
          print(f'The price of {stock} is {price}.')
  
  stocks1 = ["AAPL stocks", "MSFT stocks"]
  stocks2 = ["FB stocks", "GOOG stocks"]
  stocks3 = []
  
  get_stock_price(stocks1)
  get_stock_price(stocks2)
  get_stock_price(stocks3)
output: 
  import requests
  from bs4 import BeautifulSoup
  
  def get_stock_price(stocks):
      if not stocks:
          return
      for stock in stocks:
          url = f"https://finance.yahoo.com/quote/{stock}"
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          try:
              price = soup.find('div', {'class': 'My(6px) Pos(r) smartphone_Mt(6px)'}).find('span').text
          except AttributeError:
              price = "Price not available"
          print(f'The price of {stock} is {price}.')
  