Home > Article > Backend Development > 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!