+ 1
Whether it is possible to use "endif" in construction of if else... ?
4 Answers
+ 1
Python uses indentation to end a block of code. So if you have a conditional like if or else, it is followed by indented code underneath that is executed if the condition is met.
ex:
python = True
if python:
print ("yay python!")
else:
print ("maybe someday")
0
That is rather blank line after the unit and Python itself will understand that the unit ended? Ok. :)
0
Technically you can press the spacebar once and python accepts that just fine. But for readability sake, more is prefered. About 4-6 spaces. Most use the TAB key as a quick way to indent.