input: Write a function to fetch all horror movies from a SQLite database.
  assert fetch_horror_movies() == [('The Shining', 'horror', 1980), ('Get Out', 'horror', 2017)]
  assert fetch_horror_movies() == [('A Nightmare on Elm Street', 'horror', 1984), ('It', 'horror', 2017)]
  assert fetch_horror_movies() == [('Scream', 'horror', 1996), ('The Conjuring', 'horror', 2013)]
output: def fetch_horror_movies():
      import sqlite3
  
      connection = sqlite3.connect('movies.db')
      cursor = connection.cursor()
  
      query = "SELECT title, genre, year FROM movies WHERE genre = 'horror'"
      cursor.execute(query)
      horror_movies = cursor.fetchall()
  
      connection.close()
      return horror_movies