小白教程
所有教程
关于
Search
172.71.254.116
172.71.254.116
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Python3 注释”的源代码
本页内容
上一节:
Python3_解释器
下一节:
Python3_运算符
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:Python3 注释}}[[Category:Python 教程|10]] = Python3 注释 = 确保对模块, 函数, 方法和行内注释使用正确的风格。 Python 中的注释有单行注释和多行注释。 Python 中单行注释以 # 开头,例如: <sample title="" desc="" lang="python" hererun="1"> # 这是一个注释 print("Hello, World!") </sample> 多行注释用三个单引号 ''' 或者三个双引号 """ 将注释括起来,例如: === 1、单引号(''') === <sample title="" desc="" lang="python" hererun="1"> #!/usr/bin/python3 ''' 这是多行注释,用三个单引号 这是多行注释,用三个单引号 这是多行注释,用三个单引号 ''' print("Hello, World!") </sample> === 2、双引号(""") === <sample title="" desc="" lang="python" hererun="1"> #!/usr/bin/python3 """ 这是多行注释,用三个双引号 这是多行注释,用三个双引号 这是多行注释,用三个双引号 """ print("Hello, World!") </sample>
返回至“
Python3 注释
”。
上一节:
Python3_解释器
下一节:
Python3_运算符