input: Write a python function to fetch and print the titles of web pages from a given list of URLs.
  assert fetch_titles([
      "https://en.wikipedia.org/wiki/Python_(programming_language)",
      "https://wikipedia.org/wiki/Deep_learning",
      "https://www.wikipedia.org/wiki/Cat"
  ]) == ["Python (programming language) - Wikipedia", "Deep learning - Wikipedia", "Cat - Wikipedia"]
  assert fetch_titles([
      "https://en.wikipedia.org/wiki/Artificial_intelligence",
      "https://wikipedia.org/wiki/Machine_learning"
  ]) == ["Artificial intelligence - Wikipedia", "Machine learning - Wikipedia"]
  assert fetch_titles([
      "https://en.wikipedia.org/wiki/Data_science"
  ]) == ["Data science - Wikipedia"]
output: import requests
  from bs4 import BeautifulSoup
  
  def fetch_titles(urls):
      titles = []
      for url in urls:
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          title = soup.find('title').text
          titles.append(title)
      return titles