小编给大家分享一下python 3.3为什么使用print输出保语法错误,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨方法吧!

在python3.3使用下面的print语句打印时会报错:

print"helloWorld"

报错如下:

File "<ipython-input-3-c3365d283592>", line 1

print "hello World"

^

SyntaxError: Missing parentheses in call to 'print'. Did you mean print("hello World")?

原因:

在Python 3中print已变成可调用函数而不是语句。所以在我们使用print打印时需要将打印内容使用()包含。

如下:

print("helloWorld")

输出结果:

hello World

看完了这篇文章,相信你对python 3.3为什么使用print输出保语法错误有了一定的了解,想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!