單行注釋:一般#后面跟一個空格

            
              # 說明文字
            
          

多行注釋:(塊注釋)

            
              """
dd
ss
"""
            
          

關于代碼規范

  • Python 官方提供有一系列 PEP(Python Enhancement Proposals) 文檔
  • 其中第 8 篇文檔專門針對 Python 的代碼格式 給出了建議,也就是俗稱的 PEP 8
  • 文檔地址:https://www.python.org/dev/peps/pep-0008/
  • 谷歌有對應的中文文檔:http://zh-google-styleguide.readthedocs.io/en/latest/google-python-styleguide/python_style_rules/
    任何語言的程序員,編寫出符合規范的代碼,是開始程序生涯的第一步