Answer:
Step-by-step explanation:
The following code is written in Python, it uses the CSV import to load and read the file that is passed as an argument to the function and then prints out all the information in that CSV. First, printing out the column names, and then printing out each individual row.
import csv
def read_csv_file(file):
with open(file) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
line_count = 0
for row in csv_reader:
if line_count == 0:
print(f'Column names are: {", ".join(row)}')
line_count += 1
else:
print(f'\t{row[0]} {row[1]} {row[2]}.')
line_count += 1
print(f'There are a total of {line_count} lines.')