当前位置: 首页 > 图灵资讯 > 行业资讯> python有几种注释方法

python有几种注释方法

发布时间:2025-04-06 15:54:32

python三种注释方法

方式1:

单行注释:shift + #(输入代码前面,注释非选择代码)

多行注释:在每行前输入shift,就像单行一样。 + #(比较麻烦)

相关推荐:Python视频教程

方式2:

单行和多行一样:Ctr+ / (前提是选择需要注释的代码)

方式3:

输入''' '''或者""" """,将要注释的代码插入中间

'''
这是多行注释,使用单引号。
这是多行注释,使用单引号。
'''
"""
使用双引号是多行注释。
使用双引号是多行注释。
"""

相关文章

python3兼容python2吗

python3兼容python2吗

2025-05-09
python3 whl怎么安装

python3 whl怎么安装

2025-05-09
python 字典怎么提取value

python 字典怎么提取value

2025-05-09
python 怎样计算字符串的长度

python 怎样计算字符串的长度

2025-05-09
python 怎么样反向输出字符串

python 怎么样反向输出字符串

2025-05-09
python 怎么判断字符串开头

python 怎么判断字符串开头

2025-05-09