+ 4
Who can tell me about the global variable in python? I want to know about it.
global variable
4 Respostas
+ 3
A global variable is a variable declared outside of function ( global scope). This means, global variable can be accessed inside or outside of the function.
Variables that are only referenced inside a function are implicitly global. If a variable is assigned a value anywhere within the function’s body, it’s assumed to be a local unless explicitly declared as global.
If a variable with same name is defined inside the scope of function then its value will be used and not the global value.
+ 2
thank you very much.
0
global variable is used anywhere in your page of code and it has to define the outside the function.
- 4
can you give me your mail