Code comments for Python learning -21.python

Source: Internet
Author: User

There are two types of annotations in Python, one for general comments and one for document comments.

The general comment is using # to start

1 Print ('output something'#  Comment

Multi-line annotations in Python are also used #

1 # Comment 1 2 # Comment 2 3 # Comment 3

And the document comment is three single quotes in English

1 def Print (msg): 2     " " Output String 3     msg: string content 4     ""          5     Print (msg)

And when we use this print function, the smart hints of VS will also show the document comments

Code comments for Python learning -21.python

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.