math.pow(x, y) 會回傳x 的y 次方,計算結果以浮點數float 格式呈現( 如果需要整數,可參考內建函式pow(x, y, z) )。 import math print(math.pow(2, 5)) # 32.0. sqrt(x).
確定! 回上一頁