I'm making lists for every line in the text file with the first element being "List[linenumber]", for example, "Line1". However, I need to name these lists so I can use each one later on in the program, so I need to name each list with the first element (e.g. List1 = ["List1", "string", int])
lines = 0
user = input ("Enter GTIN-8 Code For Desired Product: ")
with open('Task2.csv') as File:
reader = csv.reader(File, delimiter=',', quotechar=',',quoting=csv.QUOTE_MINIMAL)
for row in reader:
lines = int(lines)
lines += 1
lines = str(lines)
lists = "List"
lists = lists + lines
lists = [lists] + row
print (lists)
How can I do this? Is there a line of code I can add to the for loop?
Thanks for helping.