input: Write a python function to extract titles from a given URL using BeautifulSoup.
  assert extract_titles('http://example.com') == ['Example Domain']
  assert extract_titles('https://www.python.org') != []
  assert isinstance(extract_titles('https://www.wikipedia.org'), list)
output: def extract_titles(url):
      import requests
      from bs4 import BeautifulSoup
  
      response = requests.get(url)
      soup = BeautifulSoup(response.content, 'html.parser')
      titles = [title.get_text() for title in soup.find_all('title')]
      return titles