Python help() function
Show the documentation for a function, class or module.
Syntax
help(obj)
Prints the docstring and signature. In the interactive shell it opens a pager; press q to leave.
Parameters
| obj | what you want help on |
Return value
None (it prints the help)
Example
Code
def area(w, h): """Return the area of a w by h rectangle.""" return w * h help(area)
Output
Help on function area in module __main__:
area(w, h)
Return the area of a w by h rectangle.
Related
Learn it step by step in the free lesson Modules & the Standard Library, with exercises that check your answers.