如题所述
该缩进的地方没有缩进,就会报错expected an indented block
因为Python语言是一款对缩进非常敏感的语言
比如下面的代码
会报错
File "D:/num.py", line 4
print "a>b"
^
IndentationError: expected an indented block
修改如下
从属代码块, 需要缩进
从属代码块, 需要缩进的关键字主要有
if、while、for、try-except,def 等