weixin_44574204 2022-04-03 16:44 采纳率: 100%
浏览 101
已结题

蓝桥杯python编译错误

疑问:蓝桥杯Python组别练习系统
代码在其他多个编译器上运行都没有问题,粘贴到练习系统上面提交就显示编译错误
想问下是我有什么头文件没有写吗,正式比赛也会有这样的编译错误吗?

img

编译信息如下:

Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\py_compile.py", line 144, in compile
    code = loader.source_to_code(source_bytes, dfile or file,
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "Main.py", line 5
    else:
        ^
IndentationError: unindent does not match any outer indentation level

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\py_compile.py", line 209, in main
    compile(filename, doraise=True)
  File "C:\Program Files\Python38\lib\py_compile.py", line 150, in compile
    raise py_exc
__main__.PyCompileError: Sorry: IndentationError: unindent does not match any outer indentation level (Main.py, line 5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Python38\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python38\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python38\lib\py_compile.py", line 218, in <module>
    sys.exit(main())
  File "C:\Program Files\Python38\lib\py_compile.py", line 213, in main
    if quiet < 2:
NameError: name 'quiet' is not defined

  • 写回答

3条回答 默认 最新

  • 关注

    报错是说quiet未定义还有else缩进等问题,检查一下,或者你发下完整的代码

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论 编辑记录
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月11日
  • 已采纳回答 4月3日
  • 创建了问题 4月3日

悬赏问题

  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化
  • ¥15 这种微信登录授权 谁可以做啊