Python 3.5.2打印功能不起作用

-6 python

我使用的是python版本3.5.2,打印功能对我不起作用.这是代码.我接到一个错误说:"在打电话打印时缺少优先权"

print 'Output After Training:'
Run Code Online (Sandbox Code Playgroud)

谢谢

Gra*_*ton 7

添加括号:

print('Output After Training:')
Run Code Online (Sandbox Code Playgroud)

如果您需要兼容代码以便与Python 2或3一起使用,请使用:

from __future__ import print_function
Run Code Online (Sandbox Code Playgroud)

在代码文件的开头然后使用Python 3的方式使用print().

print()在Python 3中了解更多信息: