title: Converting a list to a string
body: <p>I have extracted some data from a file and want to write it to a second file. But my program is returning the error:</p>
  
  <pre class="lang-none prettyprint-override"><code>sequence item 1: expected string, list found
  </code></pre>
  
  <p>This appears to be happening because <code>write()</code> wants a string but it is receiving a list.</p>
  
  <p>So, with respect to this code, how can I convert the list <code>buffer</code> to a string so that I can save the contents of <code>buffer</code> to <code>file2</code>?</p>
  
  <pre><code>file = open('file1.txt','r')
  file2 = open('file2.txt','w')
  buffer = []
  rec = file.readlines()
  for line in rec :
      field = line.split()
      term1 = field[0]
      buffer.append(term1)
      term2 = field[1]
      buffer.append[term2]
      file2.write(buffer)  # &lt;== error
  file.close()
  file2.close()
  </code></pre>