關於import
python
1.import math
此方法在使用math模板的函式時
需打上math
Ex: math.gcd(a,b)
2.from math import *
此方法在使用math模組時
可以省略math
Ex: gcd(a,b)
注意:用此方法import兩個以上的模組,如果模組裡的函式名
有重複,會被後import的模組覆蓋重複的函式
3.import math as abc
此方法是將math模組
取別名叫做abc
Ex: abc.gcd(a,b)
如同 math.gcd(a,b)
關於常用的library
(個人推薦)
1.copy
其中一個函式
copy.copy(x)
Return a shallow copy of x.
2.array
其中一個函式
array.append(x)
Append a new item with value x
to the end of the array.
3.random
其中一個函式
random.choice(seq)
Return a random element
from the non-empty sequence seq
4.statistics
其中一個函式
statistics.mean(data)
Return the sample arithmetic mean
of data, a sequence or iterator
of real-valued numbers.

關於Import