Home >Backend Development >Python Tutorial >How to comment in python
How to comment in python?
Comments in Python include single-line comments and multi-line comments:
Single-line comments in Python start with #, for example:
# 这是一个注释 print("Hello, World!")
Multi-line comments use three Single quotes ''' or three double quotes """ enclose comments, for example:
1, single quotes (''')
#!/usr/bin/python3 ''' 这是多行注释,用三个单引号 这是多行注释,用三个单引号 这是多行注释,用三个单引号 ''' print("Hello, World!")
2, double quotes ("" ")
#!/usr/bin/python3 """ 这是多行注释,用三个双引号 这是多行注释,用三个双引号 这是多行注释,用三个双引号 """ print("Hello, World!")
Related recommendations: "Python Tutorial"
The above is the detailed content of How to comment in python. For more information, please follow other related articles on the PHP Chinese website!