Python代码中的注释方法

Python中的注释

单行注释

单行注释使用**#**号进行注释

# hello world

多行注释

Python实际上没有多行注释的语法。由于 Python 将忽略未分配给变量的字符串文字,因此您可以在代码中添加多行字符串(三引号),并在其中添加注释。

"""hello, world"""
'''hello, world'''

上一页下一页

猜你喜欢

转载自blog.csdn.net/wzc18743083828/article/details/108898770