常用数学函数
abs(x):取x绝对值
print(abs(-32))
#运行结果
32
round(m,n):取m的近似值,精确度为n,默认取整。
print(round(3.666))
print(round(3.666,1))
print(round(3.666,2))
#运行结果
4
3.7
3.67
pow(m,n):m的n次方
print(pow(3,3))
#运行结果
27
max():取最大值,min():取最小值。里面可以写任意个参数,参数可以是序列。
print(max(34,54,24,54,56))
print(min([34,54,24,54,56]))
#运行结果
56
24
sum(item,n):求和,item为可迭代对象,n为指定相加的参数,默认为0
print(sum([1,2,3]))
print(sum([1,2,3],2))
print