Python关于运行出现错误IndentationError: unindent does not match any outer indentation level
2017-06-06 08:46
477 查看
对于利用一些文本工具编程的同学来说比较经常遇到,因为从表面上看,并不能看出来哪里有问题,例如
我这里利用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就好了!
我这里利用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就好了!
相关文章推荐
- [解决方案]Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- 【python问题系列--2】脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- 【缩进错误】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python程序编译运行出现错误:IndentationError: unindent does not match any outer indentation level
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level(转)
- Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- 【已解决】Python脚本运行出现语法错误:IndentationError: unindent does not match any outer indentation level
- Python脚本运行出现错误:IndentationError:unindent does not match any outer indentation level