title: Why does not the parameter passed to the keyword argument end in the print function of Python does not work as expected in the below context?
body: <p>I ran the following code,</p>
  <pre><code>with open('test.txt', 'r') as f:
      for line in f:
         print(line, end=' ')
  </code></pre>
  <p>I expected to get,</p>
  <pre><code>This is the first line This is the second line This is the third line
  </code></pre>
  <p>as output.</p>
  <p>Instead I got,</p>
  <pre><code>This is the first line
   This is the second line
   This is the third line 
  </code></pre>
  <p>Can someone tell me why this behavior occurs?</p>
  <p>The content in the .txt file is as below,</p>
  <pre><code>This is the first line
  This is the second line
  This is the third line
  </code></pre>