title: write() versus writelines() and concatenated strings
body: <p>So I'm learning Python. I am going through the lessons and ran into a problem where I had to condense a great many <code>target.write()</code> into a single <code>write()</code>, while having a <code>&quot;\n&quot;</code> between each user input variable(the object of <code>write()</code>).</p>
  <p>I came up with:</p>
  <pre><code>nl = &quot;\n&quot;
  lines = line1, nl, line2, nl, line3, nl
  textdoc.writelines(lines)
  </code></pre>
  <p>If I try to do:</p>
  <pre><code>textdoc.write(lines)
  </code></pre>
  <p>I get an error. But if I type:</p>
  <pre><code>textdoc.write(line1 + &quot;\n&quot; + line2 + ....)
  </code></pre>
  <p>Then it works fine. Why am I unable to use a string for a newline in <code>write()</code> but I can use it in <code>writelines()</code>?</p>
  <p>Python 2.7</p>