Python3 print statement doesn't work as expected
I am using Python 3.2.2
>>开发者_StackOverflow社区;> s = 'hhh'
>>> print s
SyntaxError: invalid syntax
>>> print(s)
hhh
>>> print 2*2
SyntaxError: invalid syntax
>>> print(2*2)
4
Why do I have to use print("...")
to print something? If I dno't it complains with 'SyntaxError'.
As of python 3.0, print
is a function. See:
http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function
精彩评论