This is simple program of reading the csv file in form of list, Program is able to print as per index but at last there is a index error
import csv
with open('file.csv','r') as f:
reader = csv.reader(f)
for r in reader:
lis = list(r)
print (lis)
file_dat = lis[0]
file_no = lis[1]
content = lis[2]
print (file_dat)
print ("File Data Read Successful")
f.close()
and the output i get of this program is
['ASFDASD', '2019-10-19', 'horse']
ASFDASD
File Data Read Successful
[]
Traceback (most recent call last):
File "C:\Users\KIRA\AppData\Local\Programs\Python\Python37-32\direction.py", line 14, in <module>
file_dat = lis[0]
IndexError: list index out of range
listis not empty and has length of3