math.floor(num)測試
math.ceil(num)ci
math.modf(num)im
num = 12.4 print(math.floor(num)) 12 print(math.ceil(num)) 13math
integer, decimal = math.modf(num) print(integer) 12 print(decimal) 0.4