Python indentation problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python indentation problem

I use cmd for practicing python codes but when i write if statement it says "indentationError: expected an indented block" what shoud i do?

5th Apr 2019, 9:07 PM
Kirubel Alemu
Kirubel Alemu - avatar
2 Answers
+ 7
Whenever you write a : somewhere, the related code needs to be indented/shifted to the right. So not if x==5: print('5') but if x==5: print('5')
5th Apr 2019, 9:09 PM
HonFu
HonFu - avatar
+ 4
kirubel indentation simply means 4 line space or simply press the tab key... it usually comes after the : key.
5th Apr 2019, 9:24 PM
Jella
Jella - avatar