The vars() built-in function

With no arguments, displays the dictionary1 of the current name area. Thus vars().keys()2 is a list of all variables defined in the current name area. With a variable as argument, displays the attributes list of this variable.