ReferenceBuilt-in functions
dir()
Lists the names defined on an object, which is how you explore an unfamiliar one.
Signature
dir(object)Parameters
| Name | Means |
|---|---|
object | any object; with no argument, the current scope |
Returns
A sorted list of attribute names.
Example
Python
print("upper" in dir(str))
print(len(dir(list)) > 10)Output
True True