导入路径#打印(math.ceil---- )打印(print ) math.ceil ) 2.3 )=、math.ceil ) print (math.ceil ) ) math.ceil math.floor (2.3 ) ) print ) math.floor )、math n round-- ' (print (round ) 2.3 )、round (2.3 ) (print ) round ) 2 round ).6 ) )的三个返回结果都是浮点型print的note : everyresultistypeoffloat ' (print (math.ceil (2(2) )、math.ceil ) math.floor(2) ) ) round(2) )结果: math.ceil----math.ceil ) 2.3 )=3math.ceil ) 2.6 )=3math.floor--
ABS(number ),返回数字的绝对值
cmath.sqrt(number )返回平方根,也可应用于负数
浮动(object )将字符串和数字转换为浮点数
help ),提供交互式帮助
输入(prompt ),获取用户输入
将int(object )、字符串和数字转换为整数
math.ceil(number )是返回值的高整数,返回类型为浮点数
math.floor(number ),返回类型为浮点数的整数
math.sqrt(number ),返回平方根不适用于负数
pow(x,y ).z ),返回x的y次幂) ) z的话,以z为模型)。
repr(object ),返回值的字符串表达式
round(number(.ndigits ) ),根据给定的精度对数字进行四舍五入
str(object ),将值转换为字符串
转载于:https://www.cn blogs.com/mainstream/p/11383136.html