Extra line in output when printing inside a loop
<p>I can't figure out why the code #1 returns an extra empty line while code #2 doesn't. Could somebody explain this? The difference is an extra comma at the end of the code #2.</p>

<pre><code># Code #1
file = open('tasks.txt')

for i, text in enumerate(filer, start=1):
    if i &gt;= 2 and i &lt;= 4:
        print "(%d) %s" % (i, text)

# Code #2
file = open('tasks.txt')

for i, text in enumerate(filer, start=1):
    if i &gt;= 2 and i &lt;= 4:
        print "(%d) %s" % (i, text),
</code></pre>

<p>Here is the content of my tasks.txt file:</p>

<pre><code>line 1
line 2
line 3
line 4
line 5
</code></pre>

<p>Result from code #1:</p>

<pre><code>(2) line 2

(3) line 3

(4) line 4
</code></pre>

<p>Result from code #2 (desired result):</p>

<pre><code>(2) line 2
(3) line 3
(4) line 4
</code></pre>
