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

来源:互联网 发布:炫踪网络 金利科技 编辑:程序博客网 时间:2024/05/20 03:44

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

我这里利用editplus来写代码的


代码运行结果:

root@ubuntu:~# cd shell/
root@ubuntu:~/shell# python 313-1.py 
  File "313-1.py", line 6
    print c
          ^
IndentationError: unindent does not match any outer indentation level
root@ubuntu:~/shell#

原因:
print c使用了4个空格,c=a+b使用了tab键。
都改成tab就好了!
阅读全文
1 0
原创粉丝点击