YouTip LogoYouTip

Python Func Globals

# Python2.x Python globals() Function [![Image 3: Python Built-in Functions](#) Python Built-in Functions](#) * * * ## Description The **globals()** function returns a dictionary containing all global variables at the current location. ## Syntax globals() function syntax: globals() ## Parameters * None ## Return Value Returns a dictionary of global variables. ## Example The following example demonstrates the usage of globals(): >>>a=''>>>print(globals())# globals function returns a dictionary of global variables, including all imported variables. {' __builtins__ ': , ' __name__ ': ' __main__ ', ' __doc__ ': None, 'a': '', ' __package__ ': None} [![Image 4: Python Built-in Functions](#) Python Built-in Functions](#)
← Python Func FrozensetPython Func Bytearray β†’