Python “expected an indented block”

前端 未结 9 1190
广开言路
广开言路 2020-12-09 08:00

Let me start off by saying that I am COMPLETELY new to programming. I have just recently picked up Python and it has consistently kicked me in the head with one recurring e

9条回答
  •  情话喂你
    2020-12-09 08:32

    Your last for statement is missing a body.

    Python expects an indented block to follow the line with the for, or to have content after the colon.

    The first style is more common, so it says it expects some indented code to follow it. You have an elif at the same indent level.

提交回复
热议问题