What are the comment characters in Python?

藏色散人
Release: 2019-10-17 11:24:58
Original
7672 people have browsed it

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
Copy after login

# 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!