Python IndentationError: expected an indented block after 'if' statement - 解决方法
E:\pythonProject1\venv\Scripts\python.exe E:\pythonProject3\main.py\n File "E:\pythonProject3\main.py", line 164\n x = random.randrange(1, 32)\n ^\nIndentationError: expected an indented block after 'if' statement on line 162\n\n进程已结束,退出代码为 1\n\n进程已结束,退出代码为 1\n\n怎么修改内容:根据错误提示,需要在第162行的if语句后面添加一个缩进块。示例代码如下:\n\nif a > b:\n x = random.randrange(1, 32)\n # 在这里添加你的代码块\n\n请根据你的实际需求,将代码块添加到if语句的后面。
原文地址: https://www.cveoy.top/t/topic/qaOR 著作权归作者所有。请勿转载和采集!