I have this array of strings:
my_array = ['5.0', '6.066', '7.5', '7.83', '9.75']
and I want to write first 3 items on my csv file.
I am using this code
n=0
with open("file.csv",'w',newline="",)as e:
while n<3:
writer=csv.writer(e)
writer.writerow(my_array[n])
n=n+1
The output is:
5,.,0
6,.,0,6,6
7,.,5
but I don't want to separate numbers with comma for example the output must be:
5.0
6.066
7.5
What should I do?