python编程出现:expected an indented block错误。

参考:https://blog.csdn.net/mjfppxx/article/details/113409846
python编程出现:expected an indented block错误。
expected an indented block翻译为:应为缩进块。

python中没有像C语言使用{}来表示从属关系,而是使用缩进表示上下级关系。

导致excepted an indented block这个错误的原因一般有两个:

冒号后面是要写上一定的内容的,例如:for循环后面不写任何代码

缩进不规范,少些或多些了一个空格缩进之后就没有报错了

你可能感兴趣的:(python)