1
00:00:07,020 --> 00:00:11,040
Remember, you should be careful with variables that have global scope,

2
00:00:11,550 --> 00:00:15,150
but don't believe the people who tell you that you should never use global

3
00:00:15,150 --> 00:00:18,000
scope. Global scope can be incredibly useful

4
00:00:18,180 --> 00:00:22,170
especially when you're defining constants. Global constants

5
00:00:22,260 --> 00:00:24,480
are variables which you define

6
00:00:24,870 --> 00:00:28,620
and you're never planning on changing it ever again. It's just something like,

7
00:00:28,650 --> 00:00:30,480
for example, the value of pi, right?

8
00:00:31,380 --> 00:00:34,950
You want to look it up once and you want to put it into your code and you never

9
00:00:34,950 --> 00:00:36,570
want to look it up ever again.

10
00:00:37,230 --> 00:00:41,940
And every other time you want to use it, say inside of a function, then all you

11
00:00:41,940 --> 00:00:45,540
want to do is just tap into that value of pi.

12
00:00:46,860 --> 00:00:50,610
So usually, in order to differentiate these constants

13
00:00:50,640 --> 00:00:54,780
which you're pretty much never going to change from the variables

14
00:00:54,780 --> 00:00:56,460
which you are likely to change,

15
00:00:56,730 --> 00:01:01,170
the naming convention in Python is to turn it into all uppercase.

16
00:01:01,740 --> 00:01:02,370
For example,

17
00:01:02,370 --> 00:01:07,370
if you had PI or you had a URL that you needed to use,

18
00:01:07,860 --> 00:01:10,020
or you have some sort of Twitter handle,

19
00:01:10,800 --> 00:01:15,240
then these are all going to be uppercased, separated with underscores.

20
00:01:15,990 --> 00:01:20,990
What this means is that later on in your function and you want to use one of

21
00:01:21,060 --> 00:01:25,260
these global constants, as soon as you type it,

22
00:01:25,380 --> 00:01:27,690
you can see it's the uppercase and you know

23
00:01:27,690 --> 00:01:31,560
to remind yourself to not modify this inside your code.

24
00:01:33,090 --> 00:01:35,340
Now that we've talked a little bit about scope,

25
00:01:35,670 --> 00:01:40,230
it's time to put your knowledge into action. Head over to the next lesson

26
00:01:40,590 --> 00:01:43,530
and I've got a quiz that will test your understanding.

27
00:01:43,860 --> 00:01:46,110
So, for all of that and more, I'll see you there.

