input: Write a python function to extract titles from a given URL using BeautifulSoup.
  assert extract_titles('https://medium.com/') != []
  assert isinstance(extract_titles('https://medium.com/'), list)
  assert all(isinstance(title, str) for title in extract_titles('https://medium.com/'))
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