根据错误提示,您需要在第122行的if语句后面添加一个缩进块。如下所示:

if event.key == K_LEFT:
    # 执行某些操作
elif event.key == K_RIGHT:
    # 执行某些操作

请确保在elif语句上面和下面都有相同的缩进级别,以便与if语句对齐。

EpythonProject1venvScriptspythonexe EpythonProject3mainpy File EpythonProject3mainpy line 124 elif eventkey == K_RIGHT ^IndentationError expected an indented block after if statement on line 1

原文地址: https://www.cveoy.top/t/topic/itfh 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录