input: Write a function to parse a CSV and generate a new CSV that adds the total number of rows, total number of columns, and total amount of data for each attribute. The function should take a filename as input and write the results to a new CSV file named 'new_csv.csv'. If the input file is empty, the new CSV should contain the header and no data.
  assert parse_csv('empty.csv')==None
  assert parse_csv('single_row.csv')==None
  assert parse_csv('multi_row.csv')==None
  assert parse_csv('missing_values.csv')==None
  assert parse_csv('large_file.csv')==None
output: 
  import csv
  
  def parse_csv(filename):
      with open(filename, 'r') as file:
          reader = csv.reader(file)
          rows = list(reader)
          
          if not rows:
              with open('new_csv.csv', 'w', newline='') as new_file:
                  writer = csv.writer(new_file)
                  writer.writerow(['Total Rows', 'Total Columns', 'Total Data'])
              return
          
          total_rows = len(rows)
          total_columns = len(rows[0]) if rows else 0
          total_data = sum(len(row) for row in rows)
          
          with open('new_csv.csv', 'w', newline='') as new_file:
              writer = csv.writer(new_file)
              writer.writerow(['Total Rows', 'Total Columns', 'Total Data'])
              writer.writerow([total_rows, total_columns, total_data])
  