I understand what print does, but of what “type” is that language element? I think it’s a function, but why does this fail?
>>> print print
SyntaxError: invalid syntax
Isn’t print a function? Shouldn’t it print something like this?
>>> print print
<function print at ...>
In 2.7 and down,
printis a statement. In python 3,printis a function. To use the print function in Python 2.6 or 2.7, you can doSee this section from the Python Language Reference, as well as PEP 3105 for why it changed.