新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python中如何快捷添加注釋
本人使用的編輯器是pycharm,有三種注釋方式:

我們一直強(qiáng)調(diào)網(wǎng)站制作、網(wǎng)站建設(shè)對(duì)于企業(yè)的重要性,如果您也覺得重要,那么就需要我們慎重對(duì)待,選擇一個(gè)安全靠譜的網(wǎng)站建設(shè)公司,企業(yè)網(wǎng)站我們建議是要么不做,要么就做好,讓網(wǎng)站能真正成為企業(yè)發(fā)展過程中的有力推手。專業(yè)網(wǎng)站制作公司不一定是大公司,成都創(chuàng)新互聯(lián)公司作為專業(yè)的網(wǎng)絡(luò)公司選擇我們就是放心。
1、用 一對(duì)""" 括起來要注釋的代碼塊。
2、用一對(duì)'''括起來要注釋的代碼塊。
3、選中要注釋的代碼,按下ctrl+/注釋。
實(shí)例
#!/usr/bin/python
#coding=gbk
# Filename: if.py
#----->1.用一對(duì)"""括起來要注釋的代碼:
"""
number = 23
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations, you guessed it.' # New blockstarts here
print "(but you do not win any prizes!)" # New blockends here
elif guess < number:
"""
#----->2.用一對(duì)'''括起來要注釋的代碼塊:
'''
print 'No, it is a little higher than that' #Another block
# You can do whatever you want in a block ...
else:
'''
#----->3.選中要注釋的代碼,按下ctrl+/注釋:
# print 'No, it is a little lower than that'
# # you must have guess > number to reach here
# print 'Done'
# # This last statement is always executed, after the ifstatement is executed
推薦學(xué)習(xí)《python教程》。
本文名稱:創(chuàng)新互聯(lián)Python教程:python中如何快捷添加注釋
瀏覽路徑:http://m.fisionsoft.com.cn/article/dhdshhh.html


咨詢
建站咨詢
