0
What is 'indentation' in simple language?
3 Answers
+ 3
Languages such as Python dont use the typical { } system. Instead the rely on a consistant amount of indentation.
if 1 == 1:
print("")
else:
print("")
Notice the consistant indent inside of the if/else statements are spaced 4 to the right. That is the indentation.
Until recently, I thought you had to have 4 spaces. Thanks to a mod on sololearn, I now know that it doesn't have to be 4, it just has to be consistantly the same amount.
+ 2
https://en.wikipedia.org/wiki/Indentation_(typesetting)
+ 1
Indentations can be spaces or tabs, which seems to be an ongoing arguement in the programming world.
Python requires indentation for blocks of code, but languages like c++ and java do not. However, it is recommened to use indentations for blocks of code for readability & neatness of code.