<abbr id="ciwa6"><option id="ciwa6"></option></abbr>
  • <sup id="ciwa6"><kbd id="ciwa6"></kbd></sup>
    <small id="ciwa6"></small>
  • 千鋒教育-做有情懷、有良心、有品質的職業教育機構

    400-811-9990
    手機站
    千鋒教育

    千鋒學習站 | 隨時隨地免費學

    千鋒教育

    掃一掃進入千鋒手機站

    領取全套視頻
    千鋒教育

    關注千鋒學習站小程序
    隨時隨地免費學習課程

    上海
    • 北京
    • 鄭州
    • 武漢
    • 成都
    • 西安
    • 沈陽
    • 廣州
    • 南京
    • 深圳
    • 大連
    • 青島
    • 杭州
    • 重慶
    當前位置:成都千鋒IT培訓  >  技術干貨  >  如何給python代碼快速添加注釋

    如何給python代碼快速添加注釋

    來源:千鋒教育
    發布人:xqq
    時間: 2023-11-07 05:13:26

    python代碼快速添加注釋的方法

    選中要注釋的代碼,按下ctrl+注釋。

    實例

    #----->1.用一對"""括起來要注釋的代碼:

    """

    number=23

    guess=int(raw_input('Enteraninteger:'))

    ifguess==number:

    print'Congratulations,youguessedit.'#Newblockstartshere

    print"(butyoudonotwinanyprizes!)"#Newblockendshere

    elifguess

    """

    #----->2.用一對'''括起來要注釋的代碼塊:

    '''

    print'No,itisalittlehigherthanthat'#Anotherblock

    #Youcandowhateveryouwantinablock...

    else:

    '''

    #----->3.選中要注釋的代碼,按下ctrl+注釋:

    #print'No,itisalittlelowerthanthat'

    ##youmusthaveguess>numbertoreachhere

    #print'Done'

    ##Thislaststatementisalwaysexecuted,aftertheifstatementisexecuted

    以上內容為大家介紹了如何給python代碼快速添加注釋,希望對大家有所幫助,如果想要了解更多Python相關知識,請關注IT培訓機構:千鋒教育。

    聲明:本站稿件版權均屬千鋒教育所有,未經許可不得擅自轉載。

    猜你喜歡LIKE

    python delattr函數如何使用?

    2023-11-10

    python time.strptime的格式化

    2023-11-10

    pythonGIL在Python多線程的應用

    2023-11-10

    最新文章NEW

    python中pdb模塊怎么用?

    2023-11-10

    Python如何截圖保存?

    2023-11-10

    python?中缺少module怎么辦?

    2023-11-10

    相關推薦HOT

    更多>>

    快速通道 更多>>

    最新開班信息 更多>>

    網友熱搜 更多>>