Python 的 abs(x) 函式可以把數值轉為絕對值。 轉換負整數為正整數 n = -123 absOfN = abs(n) print(absOfN) # 123. 轉換負浮點數為正浮點數數
確定! 回上一頁