I am using Python version 3.7.4 on Windows 10 Enterprise.
I am facing a weird issue with Python's print
function and especially sep
parameter.
In Python REPL, when I use code print(1, 2, 3, 4, 5, sep='\t')
, I get proper output as 1 2 3 4 5
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.
numbers = {1, 2, 3, 4, 5}
for n in numbers:
print(n, sep='\t')
Can someone please help me to understand why its displaying number value on a separate line?
I have attached screenshot for the reference.
Thanks.