- abs 求数值的绝对值
>>> print (abs(-10))10
- divmod 求两个数的商和余数
>>> print (divmod(5,2))(2, 1)>>> print (divmod(5.5,2))(2.0, 1.5)
- max and min 获取可迭代对象元素中的最大值或者所有参数的最大值
>>> max(1,2,3) # 传入3个参数 取3个中较大者3>>> max('1234') # 传入1个可迭代对象,取其最大元素值'4'>>> max(-1,0) # 数值默认去数值较大者0>>> max(-1,0,key = abs) # 传入了求绝对值函数,则参数都会进行求绝对值后再取较大者-1
- pow 返回两个数值的幂运算值或其与指定整数的模值
>>> import math>>> math.pow(2,4)16.0>>> 2**416
- pow:返回两个数值的幂运算值或其与指定整数的模值
def pow(*args, **kwargs): # real signature unknown"""Equivalent to x**y (with two arguments) or x**y % z (with three arguments)Some types, such as ints, are able to use a more efficient algorithm wheninvoked using the three argument form."""pass
如上所述,传入两个参数 pow(2, 3) 等同于 23,传入三个参数pow(2, 3, 4) 等同于 23 % 4
