English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Tutoriel de base Python

Contrôle de flux Python

Fonction en Python

Types de données en Python

Opérations sur les fichiers Python

Objet et classe Python

Python date and time

Advanced knowledge of Python

Python reference manual

Python help() usage and examples

Python built-in functions

The help() method calls the built-in Python help system.

The syntax of help() is:

help(object)

help() parameters

The help() method uses at most one parameter.

  • object (Optional)-You want to generate the given help object

How does help() work in Python?

The help() method is used for interactive use. When you need to write Python programs and usePython modulesIt is recommended to try using it in the interpreter when helping.

Object passed to help() (not a string)

Try these in the Python shell.

>>> help(list)
>>> help(dict)
>>> help(print)
>>> help([1, 2, 3)

If a string is passed as a parameter, the name of the module, function, class, method, keyword, or document topic, as well as the help page, will be printed.

String passed as a parameter to help()

If a string is passed as a parameter, the given string is searched as the name of a module, function, class, method, keyword, or document topic, and the help page is printed.

Try these in the Python shell.

>>> help('random thing')
>>> help('print')
>>> help('def')
>>> from math import * 
    help('math.pow')

No parameters are passed to help()

If no parameters are passed, Python's help utility (interactive help system) will start on the console.

>>> help()

Then, you can enter the name of the topic to get help on writing Python programs and using Python modules. For example:

help> True
help> 'print'
help > print

To exit the help utility and return to the interpreter, you need to enterquitand press the Enter key.

help > quit

Python built-in functions