首页 › 答案 › 题库 › 慕课 › 未分类

请运行Python软件,写出下列表达式的结果:(1)round(2.5,0)=()(2)round(3.5,0)=(3)int(2.5)=()(4)int(3.5)=

请运行Python软件,写出下列表达式的结果:(1)round(2.5,0)=()(2)round(3.5,0)=(3)int(2.5)=()(4)int(3.5)=
正确答案:2.04.023
分析:round([,ndigits])函数对x四舍五入,保留ndigits位小数,没有可选参数,四舍五入为整数。Int(x)将x转换为整数,x可以是浮点数或字符串,如果是浮点数,取整数部分