我的Python代码在elif
之后立即抛出expected indented block
错误。Python引发缩进块错误。没有看到它
我在查看缩进错误的位置时遇到了问题。
我做了什么样的缩进错误?
def expandProcedure(node, queue):
successors = []
n = 4
while (n > 0):
parent = node
depth = node[2] + 1
pathCost = node[3] + 1
newState = testState(node[0], n)
if newState == 0:
## do nothing
elif inQueue(newState[0], queue):
#do nothing
else:
s = makeNode(newState, parent, depth, pathCost)
successors.insert(0, s)
n = n - 1
return successors
'##做nothing'不计,所以你有一个空块,如果你不想做什么用'pass' – inet123