I am currently trying to loop through and print specific values from a list. The way that I am trying to do this is like this.
for i in range(len(PrintedList)):
index = i
elem=PrintedList[i]
print(elem)
print ("Product = ", PrintedList [index,1], "price £",PrintedList [index,2])
However this returns the error of :
TypeError: list indices must be integers or slices, not tuple.
I am really unsure of what to do to fix the problem.
print(PrintedList), so we can take a look at the actual structure. We can't guess by looking at code that doesn't work =)PrintledList[index][1]andPrintedList[index][2]?