python中IndentationError
来源:互联网 发布:python 金融数据接口 编辑:程序博客网 时间:2024/06/11 09:35
在 学习python中定义函数时,常常碰到一个错误,IndentationError: unindent does not match any outer indentation level,这是典型的字符缩进错误,原因一般是TAB键和空格键混用导致。
解决方法:如果使用的编辑器是notepad++,可以在通过设置:视图——显示符号——显示空格和制表符,如图所示
将其中的....(空格)和——>(TAB)改为统一格式即可,因为python3中是不支持空格和TAB键混合使用的。改为如下:
为了 方便以后编写代码,把对应的TAB,都改为空格,统一一下对齐的风格。
在Notepad++中:设置->首选项:这样设置后对于以后每次的TAB输入,都自动转换为4个空格
0 0
- python中IndentationError
- Python中遇到IndentationError
- python--IndentationError:
- python IndentationError:
- Python IndentationError
- 在Python中出现IndentationError: unexpected indent
- python中IndentationError: expected an indented block错误的解决方法
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- IndentationError: unexpected indent python
- python:IndentationError: unexpected indent
- IndentationError: unexpected indent python
- python错误之IndentationError
- IndentationError: unexpected indent python
- Python IndentationError 问题
- Python的IndentationError: unexpected indent
- 【Python】关于递进错误indentationerror
- 栈和堆的区别
- 自用图形解锁分析
- Hello world!Blog.
- 九度oj 1036
- HDOJ-1787 GCD Again(欧拉函数)
- python中IndentationError
- 栈
- Android Map根据键或者值进行排序
- Daemon 方式启动
- HPOJ 1698: 海域, 冰山, 战舰【DFS】
- Heagon的程序流程(二)
- Reorder List(***)
- LightOJ 1008 -周赛3-补题
- matlab中repmat函数的用法