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

Tutorial Básico Python

Controle de Fluxo Python

Funções do Python

Tipos de Dados do Python

Operações de Arquivos Python

Objetos e Classes 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 can use 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 an argument, the name of the module, function, class, method, keyword, or documentation topic, as well as the help page, will be printed.

String passed as an argument to help()

If a string is passed as an argument, the given string is searched as the name of a module, function, class, method, keyword, or documentation 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 arguments are passed to help()

If no arguments 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