0

I am trying to write a list to a csv file in Python. This list has strings for elements (list sample: ['Lorem', 'ipsum', 'dolor', 'sit']). I use this code to write that list to a csv:

with open("PATH HERE", "w", newline='') as wfl:
    csvwriter = csv.writer(wfl, delimiter=",")
    for word in words:
        csvwriter.writerow(word) 

But the results are not what I want...

L,o,r,e,m
i,p,s,u,m
d,o,l,o,r
s,i,t

I want it to be a word per value and not a character per value. What am I doing wrong?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65

0 Answers0