input: Write a function to convert the given SQL query into a Python function using sqlite3. The function should connect to a SQLite database named 'movies.db', execute the SQL query to select all rows from the 'Movies' table where the category is 'horror', and then print each row fetched from the database. Finally, the function should close the database connection.
  def sql_to_python(db_name):
      import sqlite3
      conn = sqlite3.connect(db_name)
      cursor = conn.cursor()
      cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
      result = cursor.fetchall()
      for row in result:
          print(row)
      conn.close()
  
  assert sql_to_python('movies.db')  # This will print rows from 'Movies' where category is 'horror'
output: def sql_to_python(db_name):
      import sqlite3
      conn = sqlite3.connect(db_name)
      cursor = conn.cursor()
      cursor.execute("SELECT * FROM Movies WHERE category = 'horror'")
      result = cursor.fetchall()
      for row in result:
          print(row)
      conn.close()