Python学习(二)-常见问题(3)IndentationError: unindent does not match any outer indentation level

Python学习(二)-常见问题(3)IndentationError: unindent does not match any outer indentation level

 

以下代码最后一行语句缩进数的空格数不一致,会导致运行错误:

 

cat b.py 
#!/usr/bin/python
if True:
    print ("Answer")
    print ("Ture")
else:
    print ("Answer")
   print ("False")     ##缩进不一致会导致致命错误

执行结果:

 

./b.py 
  File "./b.py", line 8
    print ("False")     ##缩进不一致会导致致命错误
                  ^
IndentationError: unindent does not match any outer indentation level

 

 

你可能感兴趣的:(Python学习)