0

I have a list like this:

L1 = [['myname'], [12.33333333333334]]

I want to write these items in a csv file, I can do this, but the problem is that the output is like this:

['myname'],[12.33333333333334]

I want my output gone be like this:

myname , 12.33333333333334
vinzee
  • 10,965
  • 9
  • 34
  • 51
vhdhbb
  • 1
  • 2

1 Answers1

0

Please try below solution.

import csv
L1 = [['myname'], [12.33333333333334]]
with open('test.csv', 'wb') as csvfile:
    mywriter = csv.writer(csvfile, delimiter=',')
    mywriter.writerow(L1[0] + L1[1])
Suneel Kumar
  • 4,867
  • 2
  • 28
  • 38
Vishvajit Pathak
  • 2,313
  • 17
  • 15