【发布时间】:2019-10-13 09:27:22
【问题描述】:
在我提供的代码中有一个
>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
【问题讨论】:
-
您可以为您使用的语言添加标签吗?通过指定编码的语言,您可能会找到更好的帮助。
-
除了必须与 try 相同的缩进
-
是的,很抱歉刚刚在脚本编辑器中错误地复制到 web-sight 中,它在同一个缩进中。
标签: python indentation expected-exception