Home >>Python Built-in Functions >Python locals() Function
Python locals() function is used to return the local symbol table as a dictionary. The symbol table contains necessary information about the current given program.
Syntax:locals()Here is an example of Python locals() function:
x = locals()
print(x)
x = locals()
print(x["__file__"])