The dir Function : Dir « Buildin Function « Python






The dir Function

The dir Function



#dir returns a list of the attributes and methods of any object: modules, functions, 
#strings, lists, dictionaries-pretty much anything.

li = [] 
print dir(li)                                            

d = {} 
print dir(d)                                             

           
       








Related examples in the same category

1.dir() Function: find out which names a module defines
2.dir() does not list the names of built-in functions and variablesdir() does not list the names of built-in functions and variables