Why does Python 3 code containing “print” generate output wrapped in parentheses when executed in Python 2?
19:30 13 Oct 2015

I was just using pydev for eclipse running python2.7 for an Intro to Programming course (which requires python3.x) and so I was using the updated print statement with parentheses

The issue that I am running into is that after my final while loop, the print() statement includes the parentheses.

print('Number of flushes: ', flush)

returns

('Number of flushes: ', 0)

The weird thing is that earlier in the program, before the while loop ended, the print() statement worked exactly as expected. What is going on?

python python-2.7