【发布时间】:2019-01-30 10:20:41
【问题描述】:
这是我的代码:
def options():
selection=int(input("#>"))
if selection == 1:
#Connect
elif selection == 2:
#Modules
print("Modules")
elif selection == 3:
#Checking Internet
checkInternetConnection()
elif selection == 99:
#Exit
shutdown()
else:
print "Unknown Option Selected!"
sleep(100)
sys.clear()
start()
每次我运行我都会得到这个错误:
File "main.py", line 41
elif selection == 2:
^
IndentationError: expected an indented block
我可能在这里是个菜鸟,但请有人帮忙?!谢谢
【问题讨论】:
-
您的
if语句下没有任何代码。 (评论不算数。) -
您可以使用
pass作为占位符而不是评论。 -
致 OP:阅读标题为 ““IndentationError:预期缩进块”是什么意思?”