-1

在我提供的代码中有一个

>IndentationError in line 10, or at the END of:

> while ((while_bolian == "") and (correct_count >= 0) and (total_count != 0)) or ((while_bolian == True) and (correct_count >= 0) and (total_count != 0)):

但是,我所有的缩进似乎都是正确的,我使用的是 pycharm,如果我将光标放在上面的代码行之后,它会说Indent Expected.

我已经对此错误进行了研究,但似乎没有任何帮助解决这个问题。

    total_count = int(input("how many questions do you want to be in the quizz \n10.\n50.\n100.\n:"))
    try:
        while ((while_bolian == "") and (correct_count >= 0) and (total_count != 0)) or ((while_bolian == True) and (correct_count >= 0) and (total_count != 0)):
    except ValueError:
        print("please enter a question limit")

>     line 10
        except ValueError:
        ^
IndentationError: expected an indented block

> Process finished with exit code 1
4

1 回答 1

0

while 需要一个类似的指令pass,带有额外的缩进。
现在while尝试运行except
例如,查看空 while 循环的 Python 语法

于 2019-05-28T11:58:05.617 回答