以下內容來自:
https://www.cnblogs.com/SZxiaochun/p/6961370.html
import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #這三個函數的返回結果都是浮點型
以下內容來自:
https://www.cnblogs.com/SZxiaochun/p/6961370.html
import math f = 11.2 print math.ceil(f) #向上取整 print math.floor(f) #向下取整 print round(f) #四舍五入 #這三個函數的返回結果都是浮點型
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。