Skip to main content

help()

The help() function in Python is a built-in function that is used to display information about a specific object, module, function, class, or method. It can provide a structured and detailed description of how to use the specified object, along with its parameters and functionality. This function is commonly used for exploring and learning about various Python objects and their capabilities.

Parameter Values

Parameter Description
object

An optional parameter that specifies the object to retrieve help information for. If provided, the help information for the specified object will be displayed.

Return Values

The help() function can return None or launch an interactive help session.

How to Use help() in Python

Example 1:

The help() function is used to get information about a specific object or module in Python.

help(print)
Example 2:

It displays information like the docstring and usage of the object or module.

help(list)
Example 3:

You can also use help() to get information about user-defined functions or classes.

help(MyCustomClass)