【Python】SyntaxError: Missing parentheses in call to 'print'

来源:互联网 发布:1688传淘宝系统异常 编辑:程序博客网 时间:2024/06/04 18:34

现象:

问题:
输入代码:

print “hello,world"

会出现SyntaxError: Missing parentheses in call to ‘print’的提示。

原因:
Python2支持格式print “hello world!”
Python3格式是print (“hello world!”)

注意:

Python3同样不支持每行以分号结尾。但是Python2可以(根据个人习惯使用)。

0 0
原创粉丝点击