Indent is necessary in python, its not js or cpp that you define the code that will be executed if the condition is true in {}, here indented code is just like code in curly brackets in other languages. If you want to write something out of the condition, just press the backspace. NOTE: vscode automatically indent after you write loop of conditional statement etc. See here