以下哪个表达式的值等于3?
A: round(2.5)
B: math.floor(2.5)
C: math.ceil(2.5)
D: decimal.Decimal("2.5")
A: round(2.5)
B: math.floor(2.5)
C: math.ceil(2.5)
D: decimal.Decimal("2.5")
C
举一反三
- 以下哪个表达式的值等于3? A: round(2.5) B: math.floor(2.5) C: math.ceil(2.5) D: decimal.Decimal("2.5")
- 以下哪个表达式的值等于3? A: round(2.5) B: math.floor(2.5) C: math.ceil(2.5) D: decimal.Decimal("2.5")
- Math对象的哪个方法可以返回小于等于参数的整数?() A: round() B: pow() C: floor() D: ceil()
- 下列表达式运算结果为真的是( )。 A: int(2.5)=3 B: int(2.5)=2 C: int(2.5)=2.5 D: int(2.5)=0.5
- Math对象有3个取整函数分别是 floor、round、ceil。
内容
- 0
下列算式正确的是______。 A: Int(2.5)=3 B: Int(2.5)=2 C: Int(2.5)=2.5 D: Int(2.5)=0.5
- 1
使用Math类的方法中,-4.4通过哪个方法运算后,结果为-5.0?( ) A: round B: min C: floor D: ceil
- 2
下面那个语句可返回x的整数部分 A: import math math.ceil(x) B: from math import ceil ceil(x) C: import math math.trunc(x) D: import math math.fabs(x)
- 3
运行语句math.ceil(-2.5)的结果是__1__。
- 4
以下哪些表达式的值等于3? A: 1 / 2 + 2.5 B: 10 // 2 - 2 C: ord("d") - ord("a") D: 33 % 10