input: Write a python function to extract titles from a list of URLs using BeautifulSoup and requests.
  ```python
  assert extract_titles(['https://www.example.com']) == ['Example Domain']
  assert extract_titles(['https://www.example.com', 'https://www.nonexistenturl.com']) == ['Example Domain', '[No title]']
  assert extract_titles(['https://www.google.com']) == ['Google']
output: def extract_titles(urls):
      import requests
      from bs4 import BeautifulSoup
  
      titles = []
      for url in urls:
          try:
              response = requests.get(url)
              response.raise_for_status()
              soup = BeautifulSoup(response.text, 'html.parser')
              title = soup.title.string if soup.title else '[No title]'
              titles.append(title)
          except requests.exceptions.RequestException:
              titles.append('[No title]')
      return titles