Whitespaces


#1

I have a tiny bit of experience with a few different coding languages, not even enough to call myself a beginner but what is strange about python is the spaces.

Why in the world on lesson 6 "White spaces means right spaces".

I am super confused on WHY spacing in particular lines matters. The lesson completely failed to answer the question, "This is WHY you are spacing these particular lines"


#2

In python, indentations (4 spaces) are very important, because they show which part of the lines are part of a loop or an if statement, and also helps to keep the code structured.

For example:

if 1 == 1:
    print "Nice"

With this code you know, that it will only print out "Nice", if 1 equals 1.


#3

Thank you so much. Thay was very helpful, i appreciate your time to answer my noobist question.


#4

No problem, I'm glad to help you out. It's not a nooby question at all :smiley:
Better ask if you don't understand it instead of skipping it and get confused later :slightly_smiling: