错误的使用缩进量。(导致“IndentationError:unexpected indent”、“IndentationError:unindent does not match any outer indetation level”以及“IndentationError:expected an indented block”)
记住缩进增加只用在以:结束的语句之后,而之后必须恢复到之前的缩进格式。该错误发生在如下代码中:
print('Hello!')
print('Howdy!')
或者:
if spam == 42:
print('Hello!')
print('Howdy!')
或者:
if spam == 42:
print('Hello!')
在python中,对缩进的要求很高,需要严格规范。