Python初学时的一个小错误:IndentationError: expected an indented block
2014-03-16 14:43
591 查看
初学python时,由于Python是一种敏感的语言,无论在cmd中还是编辑器中,一个不注意就会发生一些小错误。
对于IndentationError: expected an indented block这个错误也是十分容易发生的,例如:
其实这个错误的解决办法很简单,就是在print key这一行加上一个空格或Tab一下让它缩进,就能解决问题。如这样:
所以,Python就是这样一种语言,该缩进的时候就要缩进,而且一定要注意语句块的缩进是否符合自己的想法,否则一来编译不通过,而来会产生功能上的错误。
对于IndentationError: expected an indented block这个错误也是十分容易发生的,例如:
其实这个错误的解决办法很简单,就是在print key这一行加上一个空格或Tab一下让它缩进,就能解决问题。如这样:
所以,Python就是这样一种语言,该缩进的时候就要缩进,而且一定要注意语句块的缩进是否符合自己的想法,否则一来编译不通过,而来会产生功能上的错误。
相关文章推荐
- python中IndentationError: expected an indented block错误的解决方法
- 解决python中出现的IndentationError: expected an indented block的错误
- python中IndentationError: expected an indented block错误的解决方法
- python错误:IndentationError:expected an indented block
- Python 错误:IndentationError: expected an indented block
- Python错误:IndentationError: expected an indented block
- python程序有问题:错误提示:IndentationError:expected an indented block!
- python:IndentationError:expected an indented block
- python问题--缩进,IndentationError:expected an indented block
- python报错:IndentationError:expected an indented block
- python:IndentationError:expected an indented block问题
- Python问题-IndentationError: expected an indented block
- 错误:IndentationError: expected an indented block
- Python缩进问题:IndentationError:expectedan indented block
- 【Python】异常:IndentationError:expected an indented block
- Python_IndentationError:expected an indented block
- 关于Python报错:IndentationError:expected an indented block
- python3.5入门1--运行报错:IndentationError: expected an indented block
- python: IndentationError: expected an indented block问题解决
- Python: IndentationError:expected an indented block