# prints 4
print(2 + 2)
print(2 + 3) # prints 5
"""
prints the sum of
two numbers which are 2 and 2
"""
print(2 + 2)
Python支持编写简单的单行注释以及多行注释。
一个简单的单行注释将以井号(#
)字符开头。Python运行时会忽略#
字符后写的任何文本,并将其视为注释。
# This is a simple comment
print(2 + 2)
print(2 + 3) # prints 5
# This statement
# prints the sum of
# two numbers which are 2 and 2
print(2 + 2)
我们可以利用未分配给变量的多行字符串文字(使用三引号)。Python会忽略未分配给任何变量的字符串文字,因此不会影响程序执行。
"""
This statement
prints the sum of
two numbers which are 2 and 2
"""
print(2 + 2)
地址:https://www.leftso.com/article/723.html