边学边总结,今天看if语句,在if中嵌套遇到了报错,原代码如下:
Python报错:IndentationError: expected an indented block然后就报错了
Python报错:IndentationError: expected an indented block这种报错是由于缩进错误产生的,如第一图中第二个if后跟的print没有缩进,一定要注意缩进,python对此非常敏感。
改正后如下:
Python报错:IndentationError: expected an indented block这样就可以正常运行了

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-02
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2021-08-25
  • 2021-11-24
  • 2021-09-26
  • 2021-05-05
相关资源
相似解决方案