input: Write a python function to fetch and print titles from a given API endpoint.
  assert get_titles('https://jsonplaceholder.typicode.com/posts') is None
output: def get_titles(url):
      import requests
      response = requests.get(url)
      if response.status_code == 200:
          data = response.json()
          for item in data:
              print(item['title'])