python IndentationError: expected an indented block
时间: 2023-08-27 13:20:23 浏览: 103
该错误提示是Python的缩进错误,意味着在代码中期望一个缩进块,但是没有得到。这通常是由于缩进不正确导致的。在Python中,缩进是非常重要的,它用来表示代码块的开始和结束。当你在一个语句后面使用冒号(:)时,你需要在下一行开始一个缩进块来表示这个语句的内容。通常情况下,一个缩进块是由4个空格或者一个制表符组成的。所以,当你看到"IndentationError: expected an indented block"这个错误提示时,你需要检查你的代码并确保缩进是正确的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Python IndentationError: expected an indented block](https://blog.csdn.net/m0_46334316/article/details/117758770)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [python问题:IndentationError:expected an indented block错误](https://blog.csdn.net/qq_15437667/article/details/52558999)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文