python中的注释该怎么用?
发布时间:2026-04-03 15:30:28

Python中注释的使用方法:
1、单行注释,代码行 # 开头
#这是单行注释
print('helloworld')2、多行注释,使用三个单引号,或三个双引号来包括要注释的内容
使用三个单引:
#这是单行注释
'''
第一行要注释的内容
第二行要注明的内容
第三行要注明的内容
'''
print('helloworld')使用三个双引:
#这是单行注释
"""
第一行要注明的内容
第二行要注明的内容
第三行要注明的内容
"""
print('helloworld')请关注Python视频教程栏目,了解更多Python知识。
下一篇 python中如何输出空格?
