''' DS2000 Spring 2020 Source code from class - file processing This example has structured data; the input file is a csv (comma-separated values) ''' import csv def process_file(filename): ''' Function: process_file Parameter: Name of the file (a string) Returns: nested list of strings, the contents of the file Does: assumes the file to be read is a CSV file ''' data = [] with open(filename) as infile: csv_contents = csv.reader(infile, delimiter = ',') for row in csv_contents: data.append(row) return data def main(): hurricane_data = process_file('irma.csv') # For a sanity-check, print everything out for row in hurricane_data: print(row) main()