Python tutorial -- use the built-in function help () command

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.