개발일지/Python

[Python] IndentationError: expected an indented block 에러

chi_chi 2020. 8. 19. 10:53

python expected an indented block error

 

파이썬 코드 작성 시 흔히 보이는 에러이다.

 

에러 line 34를 보면 if문인데 들여쓰기가 없다.

 

python if문을 쓸때에는 다음과 같이 들여쓰기로 코드를 구분해야한다.

# Python
if 조건문1:
	명령문1
elif 조건문2:
	명령문2
else:
	명령문3

** IndentationError: expected an indented block 에러는 들여쓰기를 잘해주면 해결이 된다.