C:\Users\konglb>python
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'hello, python world';
File "<stdin>", line 1
print 'hello, python world';
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('hello,
python world';)?
其實這個錯誤信息,是因為Python3中取消了以前Python 2中的語法,兩者在打印輸出的語法上有所差別,所以在Python 3下面使用之前的語法格式就會報錯,錯誤信息已經提示你需要加上括號,字符串可以用單引號或雙引號括起來,正確語法格式如下所示:
C:\Users\konglb>python -V
Python 3.6.3
>>> print ('hello,python world')
hello,python world
>>> print("you are right")
you are right
>>>