title: How to write all items on same line in the csv file python
body: <p>My code is like this:</p>
  
  <pre><code>F = open('words.csv', 'w') 
  F.write(words + n1 + n2 )
  </code></pre>
  
  <p>Here words, n1, n2 are the lists of items.</p>
  
  <p>But the output in the CSV file is like this:</p>
  
  <pre><code>Hi 6
  1376
  Hello 39
  697
  Nihao 30
  396
  </code></pre>
  
  <p>My question is how to write all the items on the same line, e.g.,</p>
  
  <pre><code>Hi 6 1376
  Hello 39 697
  Nihao 30 396
  </code></pre>
  
  <p>Thank you.</p>