input: Write a function to create a web scraper that retrieves the 10 most recent articles from a specified news website URL using Python. The function should print the text content of each of the 10 articles. If no articles are found or the website cannot be accessed, the function should handle the error gracefully and print an appropriate message.
  assert retrieve_articles('http://example.com/news')=="""...article text content..."""
  assert retrieve_articles('http://nonexistentwebsite.com')=="""Unable to retrieve articles."""
  assert retrieve_articles('http://example.com/noarticles')=="""No articles found."""
  assert retrieve_articles('')=="""Invalid URL."""
output: def retrieve_articles(url):
      import requests
      from bs4 import BeautifulSoup
      try:
          response = requests.get(url)
          response.raise_for_status()
      except requests.exceptions.RequestException:
          print("Unable to retrieve articles.")
          return
      if not url:
          print("Invalid URL.")
          return
      soup = BeautifulSoup(response.text, 'html.parser')
      articles = soup.find_all('article')[:10]
      if not articles:
          print("No articles found.")
          return
      for article in articles:
          print(article.get_text())