I am a beginner in python. How do I modify the code below to write out the list to a csv file with 2 columns of output as below.
1 1
2 1
3 1
4 1
5 1
Right now, the output is below
(1, 1)
(2, 1)
(3, 1)
(4, 1)
(5, 1)
list = [(1,1),(2,1),(3,1),(4,1),(5,1)]
with open(test.csv, 'wb') as testfile:
csv_writer = csv.writer(testfile)
for i in list:
csv_writer.writerow([i])
Greatly appreciate your help.