python代碼快速添加注釋的方法
選中要注釋的代碼,按下ctrl+注釋。
實(shí)例
#----->1.用一對(duì)"""括起來(lái)要注釋的代碼:
"""
number=23
guess=int(raw_input('Enteraninteger:'))
ifguess==number:
print'Congratulations,youguessedit.'#Newblockstartshere
print"(butyoudonotwinanyprizes!)"#Newblockendshere
elifguess """ #----->2.用一對(duì)'''括起來(lái)要注釋的代碼塊: ''' print'No,itisalittlehigherthanthat'#Anotherblock #Youcandowhateveryouwantinablock... else: ''' #----->3.選中要注釋的代碼,按下ctrl+注釋: #print'No,itisalittlelowerthanthat' ##youmusthaveguess>numbertoreachhere #print'Done' ##Thislaststatementisalwaysexecuted,aftertheifstatementisexecuted 以上內(nèi)容為大家介紹了如何給python代碼快速添加注釋?zhuān)M麑?duì)大家有所幫助,如果想要了解更多Python相關(guān)知識(shí),請(qǐng)關(guān)注IT培訓(xùn)機(jī)構(gòu):千鋒教育。