Home >Backend Development >Python Tutorial >What are the comment characters in Python?

What are the comment characters in Python?

藏色散人
藏色散人Original
2019-10-17 11:24:327730browse

What are the comment characters in Python?

What are the comment characters in Python?

Python's comment characters include single-line comment characters and multi-line comment characters.

Recommended: "Python Tutorial"

1. python single-line comment symbol (#)

pound sign (#) is often used as a single-line comment symbol. When # is used in code, any data to the right of it will be ignored and treated as a comment. The content to the right of

print 1 #输出1

# will not be output during execution.

2. Batch and multi-line comment symbols

In python, there will also be comments with many lines. In this case, batch multi-line comment symbols are needed. . Multi-line comments are enclosed in triple quotes ''' '''.

The above is the detailed content of What are the comment characters in Python?. 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