00:01
This question asks us if we can change the value of a global constant, if that value of a global constant can only be changed within a function? so the first we can examine is can we even change a global constant inside a function? and i'll assume we're talking about the language of python for the purposes of this problem.
00:20
In python, as long as we say we declare a global variable, x equals 10, and then inside a function here we have a function called change.
00:31
Perhaps right inside the function we have we can change its value as long as we use a global keyword in python that's important so you can call global x right and then you could say x equals x plus 2 and then from here we could say print x inside the function and then we can just call change out here so when we run this clearly you can see that first the value of x equal to 10 as a global constant then inside the function we reference a global global x we change that value to be 12 and we print it out we'll get 12.
01:17
So when we apply using the global keyword we can see that we can indeed change the value of a constant a global constant inside of a function.
01:34
And so the same thing should apply for outside of a function.
01:39
As long as the value is like this, we should just essentially be able to say x equals x plus 2 and change the value of the global variable.
01:48
Now, let's say we're talking about a different programming language, for example, javascript or c or something in that order, where we're talking about a constant value in the context that.
02:02
We have established that it is a constant variable type.
02:07
In that case, it's a constant variable, it cannot be changed after its initialization no matter what we do...