In Python I want to list out each number inside a simple CSV...
CSV:
07555555555, 07555555551
This is what I have tried:
for number in csv.reader(instance.data_file.read().splitlines()):
print(number)
However, this outputs the whole thing as one string like this...
['07446164630', '07755555555']
Why?
I have also tried to loop like this
for i, item in enumerate(csv.reader(instance.data_file.read().splitlines())):
print(i)
print(item)
I'm not sure I fully understand what I'm doing wrong so any help in explaining how to print each number in the file would be amazing.
csvhas just a line of 2 elements so it is returning just a list of two elements likeprint(['07446164630', '07755555555'])