Python报错: 会标明文件名称,错误位置,错误类型,错误具体描述 1):NameError(变量名字错误) 错误的具体描述:name ‘Night’ is not defined “变量名’Night‘没有被定义”。 2):SyntaxError(语法错误) 错误的具体描述:invalid syntax,就是“无效语句” 错误的具体描述:invalid character in indentifier,也就是“标识符中有无效字符” 3):IndentationError(缩进错误) 错误的具体描述:unexpected indent(不正确的缩进)