天天看点

Python关于运行出现错误IndentationError: unindent does not match any outer indentation level

对于利用一些文本工具编程的同学来说比较经常遇到,因为从表面上看,并不能看出来哪里有问题,例如

我这里利用editplus来写代码的

Python关于运行出现错误IndentationError: unindent does not match any outer indentation level

代码运行结果:

[email protected]:~# cd shell/

[email protected]:~/shell# python 313-1.py 

  File "313-1.py", line 6

    print c

          ^

IndentationError: unindent does not match any outer indentation level

[email protected]:~/shell#

原因:

print c使用了4个空格,c=a+b使用了tab键。

都改成tab就好了!