title: Write the output in the same line of a file with Python
body: <p>I'm trying to write the ouput from  list in the same line of a .txt file,so if my lists are a=[1,2,3] and b=[3,4,5]. I would like to have a .txt file like this:
  1,2,3
  3,4,5
  Instead of this:
  1
  2
  3
  3
  ...
  I would like to do somthing like:</p>
  
  <pre><code>for i in a:print i,
  </code></pre>
  
  <p>with the ",", but with output.write(i), it doesn't works. How can I do that? Thanks a lot!</p>