Instructor: I wanna add a quick note
about this spacing that we see in this code.
Now, this isn't just for Python.
In other languages, you'll always see this.
You're not going to see that every single line of code
always starts, as well, in the first space.
Different languages will use this differently,
but in order to organize code,
usually you'll see some indentation like this.
Now, Python, however, is unique
because the indentation and spaces that we see here
makes the interpreter see it and say,
"Hey, this means something."
The interpreter would actually see the space
and say, "Because there's space here,
I know that this is part of the if block."
In other languages, like JavaScript,
well you have something similar,
but usually you'll have an if statement
and then some condition followed by,
make sure I spell condition right,
followed by something like a curly brace.
And in here, whatever is in here,
you can see that I still get the space
and I can do whatever I want.
But, JavaScript interpreter
doesn't really care that there's spaces.
If I want, I could write my code just on one line like this
and it's still valid in JavaScript code.
So people usually do the spacing more for style purposes.
Python, on the other hand,
is not just for styling that we do this
but because the interpreter
actually finds meaning in the spaces,
which is actually one of the big selling point with Python.
It's very clean.
There's no extra stuff here that makes it difficult.
I mean, it's just English, right?
If is_old and if is_licensed, then print this.
It's just really nice to read and really clean.
Now, if you notice here, my editor,
and we're gonna talk about editors and IDs
in an upcoming section,
but if you are using the proper tools,
this automatically is created for you.
Now, in the programming world,
there's this debate about tabs and spaces,
and we're not going to get into it.
It's frankly a little bit silly.
That is some people prefer to,
here if they want to create a space,
they might use spaces or they might use tabs.
At the end of the day, with Python,
the rule is we can use spaces, you can use the tab,
but the idea that if you use spaces,
you usually use four spaces.
It's just a standard.
Now, if you notice here, I actually don't have four spaces.
It's two spaces here.
And that is because up until now, well,
I've just been following along whatever this editor gives me
but if you look over here, there's an auto format button.
If I click on this, it automatically formats my code
into the appropriate format.
And you see right over here that I now have for spaces.
But you see that the code still works.
Again, it's because at the end of the day,
the important part is that there's a distinction
between hierarchies.
That is the top and then maybe the children.
But the interpreter itself is going to notice these spaces.
So you do have to be careful
because based on where this print is,
as soon as I add a tab in here and I click run,
well, I get is_old and is_licensed.
But as soon as one of this is false and I click run,
you see that okok runs only if this condition fails.
Again, if previously both of these were true,
I only get the first line printed.
So that little space here changes the outcome of my program.
So you have to really be careful with this
and luckily your editor, or where you code,
is going to help you out with this.
But it is a gotcha
that if you're just starting out, you wanna be mindful of.
All right, no more debates about spaces and tabs.
I'll see you in the next video.
Bye-bye.