W3School TIY Editor

  • W3School 在线教程
  • 改变方向
  • 暗黑模式
​x
 
# 导入数学库
import math
​
# 将数字向上舍入到最接近的整数
x = math.ceil(1.4)
​
# 将数字向下舍入到最接近的整数
y = math.floor(1.4)
​
print(x)
print(y)