The globals()
function in Python returns a dictionary representing the current global symbol table. This dictionary contains all global variables and their values currently available in the program, including built-in functions and modules. It can be used to access and modify global variables from within a function or method.
Parameter Values
This function does not accept any parameters.Return Values
The globals()
function in Python returns a dictionary of the current global symbol table.
How to Use globals()
in Python
Example 1:
Return a dictionary representing the current global symbol table.
globals()