1:數據類型是不允許改變的,如果改變Number數據類型的值,將重新分配空間。
2:Python Number類型轉換
3:Python math 模塊、cmath 模塊
Python 中數學運算常用的函數基本都在 math 模塊、cmath 模塊中。
Python math 模塊提供了許多對浮點數的數學運算函數。
Python cmath 模塊包含了一些用於複數運算的函數。
cmath 模塊的函數跟 math 模塊函數基本一致,區別是 cmath 模塊運算的是複數,math 模塊運算的是數學運算。
要使用 math 或 cmath 函數必須先導入。