Python3 comments


Make sure to use the correct style for modules, functions, methods and inline comments

Comments in Python have single-line comments and multi-line comments:

Single-line comments in Python end with # Beginning, for example:

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

Multi-line comments should be enclosed in three single quotes (''') or three double quotes ("""), for example:

1, Single quotation mark (''')

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

2, double quotation mark (''')

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