I have an external .csv file which I read into a 2 dimensional list, sort it, then print it. I don't want the square brackets when it prints, how do I get rid of them?
def bubbleSort(hi):
for passnum in range(len(hi)-1,0,-1):
for i in range(passnum):
if hi[i]>hi[i+1]:
temp = hi[i]
hi[i] = hi[i+1]
hi[i+1] = temp
hi =[]
with open('winners.csv', 'r') as textfile:
for row in reversed(list(csv.reader(textfile))):
#create the file into an array
hi.append(row)
#initiate the bubble sort on the array
bubbleSort(hi)
# print the top 5 winners
for i in range(5):
print(hi[i])
gives the output:
[score, name]
[score, name]
[score, name]
[score, name]
[score, name]
i would just like to be rid of the brackets if possible. so it looks like:
score, name
score, name
score, name
score, name
score, name