Join the content of files to one file
<p>I have two files and I want to join the content of them into one file side-by-side, i.e., line n of the output file should consist of line n of file 1 and line n of file 2. The files have the same number of lines.</p>

<p>What I have until now:</p>

<pre><code>with open('test1.txt', 'r') as f1, open('test2.txt', 'r') as f2:

    with open('joinfile.txt', 'w') as fout:

        fout.write(f1+f2)
</code></pre>

<p>but it gives an error saying -  </p>

<pre><code>TypeError: unsupported operand type(s) for +: 'file' and 'file'
</code></pre>

<p>What am I doing wrong?</p>
