Home>Article>Backend Development> What symbols are used for Python comments?

What symbols are used for Python comments?

藏色散人
藏色散人 Original
2019-07-05 09:43:40 25486browse

What symbols are used for Python comments?

Python is a computer programming language. It is an object-oriented dynamic type language that was originally designed for writing automated scripts (shells). With the continuous updates of the version and the addition of new language features, it is increasingly used for the development of independent and large-scale projects.

What symbols are used for Python comments?

Comments in Python include single-line comments and multi-line comments. Single-line comments in Python start with the # symbol, and multi-line comments use three A single quote ''' symbol or three double quotes """ symbols enclose the comment.

Example:

# 这是一个注释 print("Hello, World!")

#!/usr/bin/python3 ''' 这是多行注释,用三个单引号 这是多行注释,用三个单引号 这是多行注释,用三个单引号 ''' print("Hello, World!")

#!/usr/bin/python3 """ 这是多行注释,用三个双引号 这是多行注释,用三个双引号 这是多行注释,用三个双引号 """ print("Hello, World!")

Related recommendations: "Python Tutorial"

The above is the detailed content of What symbols are used for Python comments?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn