Python 'print' function 'sep' parameter is not working as expected : <p>I am using Python version 3.7.4 on Windows 10 Enterprise.</p>

<p>I am facing a weird issue with Python's <code>print</code> function and especially <code>sep</code> parameter. </p>

<p>In Python REPL, when I use code <code>print(1, 2, 3, 4, 5, sep='\t')</code>, I get proper output as <code>1    2    3    4    5</code></p>

<p>However when code tries to iterate over a collection as shown below, instead of showing number separated by a tab, it always displays individual value on a new line.</p>

<pre><code>numbers = {1, 2, 3, 4, 5}
for n in numbers:
    print(n, sep='\t')
</code></pre>

<p>Can someone please help me to understand why its displaying number value on a separate line? </p>

<p>I have attached screenshot for the reference.</p>

<p><a href="https://i.stack.imgur.com/2R1C5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2R1C5.png" alt="Python print function sep parameter"></a></p>

<p>Thanks.</p>
