初級 › IndentationError: expected an indented block の原因と直し方 › パターン4
IndentationError: expected an indented block の原因と直し方
if・for・def・whileの本体を書き忘れたときに出る、Python学習者が最初につまずくエラーです。
1 while True: 2 ____break ^
File "main.py", line 2
break
^^^^^
IndentationError: expected an indented block after 'while' statement on line 1
空欄を埋めて実行を通す
whileループの本体にもインデントが必要です。1行だけの本体でも省略はできません。
次の問題