globals() function in Python returns the dictionary of current global symbol table.
Symbol table: Symbol table is a data structure which contains all necessary information about the program. These include variable names, methods, classes, etc.
Global symbol table stores all information related to the global scope of the program, and is accessed in Python using globals() method.
The functions, variables which are not associated with any class or function are stored in global scope.
Syntax: globals() Parameters: No parameters required.
Before modification: gautam After modification: gautam karakoti
Note: We can also change the value of global variables by using globals() function. The changed value also updated in the symbol table.
- Python | dir() function
- Python | How to get function name ?
- Python | int() function
- Python | now() function
- Python map() function
- Python | oct() function
- Python | hex() function
- Help function in Python
- sum() function in Python
- ord() function in Python
- Python | cmp() function
- id() function in Python
- Python | fsum() function
- Python | frexp() Function
- Python statistics | mean() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.