The help function is a built-in function of python. It is a built-in function that can be used at any time. What can the help function do, how to use the help function to view the usage of the function in the python module, and what issues need to be paid attention to when using the help function, which is briefly described below.
What can help functions do?
When writing code using python, python built-in functions or modules are often used. The usage of some uncommonly used functions or modules is not very clear. At this time, you need to use the help function to view help.
Note that the help () function is a detailed description of the function or module usage, and the dir () function is used to view the operation methods in the function or module, the output is the method list.
How to use the help function to view the usage of functions in the python module
Enter parameters in brackets for help (). The procedure is simple.
Use the help function to view help information.
When writing The help () function usage method, you should fill in parameters in brackets. Pay attention to the parameter format here:
1. View the help of a module
>>> Help ('sys ')
Then it opens the help document for this module.
2. View the help of a data type
>>> Help ('str ')
Returns the string method and detailed description.
>>> A = [1, 2, 3]
>>> Help ()
At this time, help (a) will open the list operation method
>>> Help (a. append)
The list append method help is displayed.