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
vvvvv
  • 25,404
  • 19
  • 49
  • 81
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
  • 5,621
  • 3
  • 31
  • 44
Vishvajit Pathak
  • 3,351
  • 1
  • 21
  • 16