1.python 注释
确保对模块, 函数, 方法和行内注释使用正确的风格
Python中的注释有单行注释和多行注释:
1.1 单行注释(#)
Python中单行注释以 # 开头,例如:
[root@python 20200817]# cat 01.py
#!/usr/bin/python
#这是注释
print(“hello me”)
多行注释用三个单引号 ‘’’ 或者三个双引号 “”" 将注释括起来,例如:
1.2 单引号(’’’)
[root@python 20200817]# cat 01.py
#!/usr/bin/python
#这是注释
‘’’
这是多行注释
这是多行注释
这是多行注释
‘’’
print(“hello me”)
[root@python 20200817]# python 01.py
hello me
1.3 双引号(""")
[root@python 20200817]# cat 01.py
#!/usr/bin/python
#这是注释
“”"
这是多行注释
这是多行注释
这是多行注释
“”"
print(“hello me”)
[root@python 20200817]# python 01.py
hello me