Skip to content

Tag: global-variables

Setting back global variables back to their default value

In game,I have created some global variables whose value changes when a certain action occur.When I restart the game,I want their value to be set again to their initial value. I can change global variable value by equilazing it back to its original value. Is there any other way to do so,when there are lot of …

Reason for globals() in Python?

What is the reason of having globals() function in Python? It only returns dictionary of global variables, which are already global, so they can be used anywhere… I’m asking only out of curiosity, trying to learn python. I can’t really see the point here? Only time I would need it, was if I …