dir()
The dir()
function is used to get a list of all the attributes and methods of an object. This function takes one argument and returns a list of strings. For example, dir("Hello World")
would return a list of all the attributes and methods of the string object.