input: Write a function to rewrite the given SQL query in Python. The function should connect to the 'movies.db' database, execute the SQL query to select all movies from the 'Movies' table where the category is 'horror', and print each row of the result.
  import sqlite3
  
  def query_movies():
      conn = sqlite3.connect('movies.db') 
      cursor = conn.cursor()
  
      cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
      result = cursor.fetchall()
      for row in result:
          print(row)
  
      conn.close()
  
  assert query_movies() is None
output: def query_movies():
      conn = sqlite3.connect('movies.db') 
      cursor = conn.cursor()
  
      cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
      result = cursor.fetchall()
      for row in result:
          print(row)
  
      conn.close()