1、python中的注解:
單行注解 #
多行注解 '''? ?.....? ''' 或 """ ...... """
2、python多行語句:
Python 通常是一行寫完一條語句,但如果語句很長,我們可以使用反斜杠(\)來實現(xiàn)多行語句
total = item_one + \
? ? ? ? item_two + \
? ? ? ? item_three
在 [], {}, 或 () 中的多行語句,不需要使用反斜杠(\),例如:
total = ['item_one', 'item_two', 'item_three',?
?????????'item_four', 'item_five']
print輸出:print 默認(rèn)輸出是換行的,如果要實現(xiàn)不換行需要在變量末尾加上?end="":??print( x, end=" " )
3、導(dǎo)入模塊
將整個模塊(somemodule)導(dǎo)入,格式為:?import somemodule
從某個模塊中導(dǎo)入某個函數(shù),格式為:?from somemodule? import? ?somefunction
從某個模塊中導(dǎo)入多個函數(shù),格式為:?from somemodule? import? firstfunc, secondfunc
將某個模塊中的全部函數(shù)導(dǎo)入,格式為:?from somemodule import *