Remember, you should be careful with variables that have global scope,
but don't believe the people who tell you that you should never use global
scope. Global scope can be incredibly useful
especially when you're defining constants. Global constants
are variables which you define
and you're never planning on changing it ever again. It's just something like,
for example, the value of pi, right?
You want to look it up once and you want to put it into your code and you never
want to look it up ever again.
And every other time you want to use it, say inside of a function, then all you
want to do is just tap into that value of pi.
So usually, in order to differentiate these constants
which you're pretty much never going to change from the variables
which you are likely to change,
the naming convention in Python is to turn it into all uppercase.
For example,
if you had PI or you had a URL that you needed to use,
or you have some sort of Twitter handle,
then these are all going to be uppercased, separated with underscores.
What this means is that later on in your function and you want to use one of
these global constants, as soon as you type it,
you can see it's the uppercase and you know
to remind yourself to not modify this inside your code.
Now that we've talked a little bit about scope,
it's time to put your knowledge into action. Head over to the next lesson
and I've got a quiz that will test your understanding.
So, for all of that and more, I'll see you there.