+ 1
What is global keyword
3 Respostas
+ 5
Please specify the language in your question tags to improve context clarity 👍
+ 2
the keyword “global” is used with a variable declaration in some languages, and makes the variable available in the entire code.
+ 2
In Python global keyword is used in code blocks of functions (or classes) to prevent variables that are defined in functions to be automatically destroyed.
In code blocks of classes, instead of being destroyed the variables would only becomr available with the namespace of the class.