这是什么问题?
代码 SyntaxError · Python 报告的问题。
译文说明
当解析器遇到语法错误时引发。这可能发生在导入语句中、调用内置函数compile()、exec() 或eval() 中,或者读取初始脚本或标准输入(也可以交互方式)时。
异常实例的 str() 仅返回错误消息。详细信息是一个元组,其成员也可作为单独的属性使用。
Google Translate · 此内容为自动翻译。技术术语及适用条件请以英文原文为准。
官方说明 · 原文
Raised when the parser encounters a syntax error. This may occur in an import statement, in a call to the built-in functions compile(), exec(), or eval(), or when reading the initial script or standard input (also interactively).
The str() of the exception instance returns only the error message. Details is a tuple whose members are also available as separate attributes.