dir()

Built-in FunctionPython 2.0+Intermediate

Lists the names (attributes and methods) of an object or current scope

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
print(dir(int)[:5])
print(dir(str)[:5])

dir() is a built-in function that lists the names (attributes and methods) of an object or current scope.

Try in Playground

Tags

builtinfunctioncoreintrospection

Related Items