input: Write a function to convert an SQL query into a Python program that executes the query and prints the results. The function receives the SQL query as a string, along with optional parameters for the database connection details and any specific where clauses. If no where clauses are provided, the function should execute the query without any filtering conditions.
  assert execute_sql_query("SELECT * FROM orders", 2020)==None
  assert execute_sql_query("SELECT * FROM orders", 2020, "<connection details>")==None
  assert execute_sql_query("SELECT * FROM orders", year=2020, connection="<connection details>")==None
  assert execute_sql_query("SELECT * FROM orders")==None
output: def execute_sql_query(query, year=None, connection=None):
      if connection:
          import sqlite3
          conn = sqlite3.connect(connection)
          cursor = conn.cursor()
          if year:
              cursor.execute(query + " WHERE year = ?", (year,))
          else:
              cursor.execute(query)
          results = cursor.fetchall()
          for row in results:
              print(row)
          conn.close()
      else:
          print("No connection details provided.")