[Python] 註解和IDLE介面

[Python] 註解和IDLE介面
2018/11/26更新

#
單行註解

Syntax:
#

EX:
print(‘how are you?’) #這是打招呼
#########################################

“””
多行註解(雙引號)

Syntax:
“””

EX:
“””
a = 1
print(‘i love you’)
“””
#########################################

help
查看幫助檔案

Syntax:
help()

EX:
help(print)

ps.在IDLE模式下(IDLE is Python’s Integrated Development and Learning Environment)或者是在DOS底下執行python
#########################################

q
離開help模式

Syntax:
q

EX:
help> q
直接在help輸入q執行,或者直接按下Enter按鍵
又或者直接在鍵盤上按Ctrl + d

python 程式語言,並沒有使用 { } 來表示區塊 block 的觀念,主要都是透過縮排來表示,這一點讓剛學 python 的我相當不習慣。

Reference:
ps.在IDLE模式下(IDLE is Python’s Integrated Development and Learning Environment)或者是在DOS底下執行python
#########################################

exit
離開(離開IDLE模式)

Syntax:
exit()

EX:
exit()
#########################################

()
字串太長,可以使用小括號

Syntax:
()

EX:
c = 'abcdefghijklm'  #原始過長的字串
c = ('abcde'             #分割過後的字串
'fghijkml')

留言