input: Write a function to read a CSV file and write another CSV file with only the first and third columns.
  assert read_and_write_csv('input.csv', 'output.csv') == [['A', 'C'], ['1', '3'], ['4', '6'], ['7', '9']]
  assert read_and_write_csv('data.csv', 'filtered.csv') == [['A', 'C'], ['apple', 'carrot'], ['banana', 'cabbage'], ['pear', 'broccoli']]
  assert read_and_write_csv('example.csv', 'result.csv') == [['A', 'C'], ['10', '30'], ['40', '60'], ['70', '90']]
output: import csv
  
  def read_and_write_csv(input_file, output_file):
      with open(input_file, 'r', newline='') as infile:
          reader = csv.reader(infile)
          rows = [row for row in reader]
          
      selected_columns = [[row[0], row[2]] for row in rows]
      
      with open(output_file, 'w', newline='') as outfile:
          writer = csv.writer(outfile)
          writer.writerows(selected_columns)
          
      return selected_columns