input: Write a function to extract and print all page titles from a base URL using BeautifulSoup.
  assert extract_titles('https://www.example.com')==['Example Domain', 'More Information'] 
  assert extract_titles('https://www.test.com')==['Test Page 1', 'Test Page 2', 'Test Page 3']
  assert extract_titles('https://www.sample.com')==['Sample Home', 'Sample About', 'Sample Contact']
output: def extract_titles(base_url):
      import requests
      from bs4 import BeautifulSoup
      
      response = requests.get(base_url)
      soup = BeautifulSoup(response.content, 'html.parser')
      titles = [title.get_text() for title in soup.find_all('title')]
      return titles