I took a course to learn python; In my course, I have to do a project with the following conditions:
- I have to use a template which is prepared by the teacher.
- All the codes should be written in function
- It needs to open a CSV file and have a file (txt/csv) as the output.
Now, my question is how to refer to the files with the following structure:
def function (input_file_name, output_file_name):
Below please find a sample and simple code:
import csv
def function(input_file):
with open ('filename.csv') as input_file:
reader = csv.reader(input_file_name)
for row in reader:
print(row)
but there is no output in my terminal!
What is my mistake?