python 错误之SyntaxError: Missing parentheses in call to 'print'

SyntaxError: Missing parentheses in call to 'print'

由于python的版本差异,造成的错误。

python2:

print "hello python!"

python3:

print ("hello python!")

 

 

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print "hello"
SyntaxError: Missing parentheses in call to 'print'
>>> print ("hello")
hello

 

转载于:https://www.cnblogs.com/myis55555/p/6656310.html

你可能感兴趣的:(python 错误之SyntaxError: Missing parentheses in call to 'print')