IndentationError: expected an indented block

Posted 邓戈麟

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IndentationError: expected an indented block相关的知识,希望对你有一定的参考价值。

 

在if条件判断中,print需要按Tab键缩进,否则会报错

 

IndentationError: expected an indented block

 

1 age = 20
2 if age >= 18:
3     print(your age is, age)
4     print(adult)

 

以上是关于IndentationError: expected an indented block的主要内容,如果未能解决你的问题,请参考以下文章

IndentationError: expected an indented block

python问题:IndentationError:expected an indented block错误

python问题:IndentationError:expected an indented block错误解决《转》

IndentationError: expected an indented block错误

Python报错:IndentationError: expected an indented block

IndentationError:expected an indented block错误解决