help()
A built-in function that shows the documentation, including the docstring, for a function, method, class or module.
In more detail
help(str.find) explains find; help(math) describes the whole module. In a terminal it may open a pager: press q to leave. Your own docstrings appear in help too.
Example
help(str.split)Related terms
- docstring — A string literal placed as the first statement of a module, function or class, which Python keeps as its documentation.
- dir() — A built-in function that lists the names, such as methods and attributes, available on an object or module.
Taught in
- Methods, Attributes And self — Hands-on Python: Complete Video Course & Book
- A Standard Library Tour — Hands-on Python: Complete Video Course & Book
- Formatting, Linting And Style — Hands-on Python: Complete Video Course & Book