單行注釋?zhuān)阂话?后面跟一個(gè)空格

            
              # 說(shuō)明文字
            
          

多行注釋?zhuān)海▔K注釋?zhuān)?

            
              """
dd
ss
"""
            
          

關(guān)于代碼規(guī)范

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