abs
#三角函数均需采用弧度制
math.cos
math.sin
math.tan
divmod #返回商和余数
max
min
math.sqrt
math.pi
左闭右开
random.randrange([minimum_value,] maximum_value) #默认最小值为零,最大值为maximum_value-1。
range([initial_value,] final_value [, step]) #默认最小值为零,默认步长为一,最大值为maximum_value-1。
指定精度的四舍五入
round(number * 10 ** precision)/ 10 ** precision
字符串
从字符串中提取单个字符的方法除了索引值以外,还可以分解到多个变量中。
检索部分字符串也是索引使用左闭右开式的表示方法。
#缩减首尾空白字符
string.strip()
#替换字符串
string.replace(search, replace)
#字符串计数
len(string)
#查找字符串位置,返回第一次出现的位置
string.find( search )
#字符串大小写转换
string.upper()
string.lower()
#数字转为字符串
str(number)
#检查字符串是否为数字
re.match(IS_NUMBER, string)
布尔表达式
#逻辑连接符:与或非
and
or
not
#在指定序列中是否存在目标变量
in
not in