内置函数的基本作用介绍

python中内置了很多的函数,现大致说下这些内置函数的作用:

函数(运算相关) 例子 作用说明               
abs() abs(-1)/abs(1) 取绝对值
max() max([1,2,3])  取最大值
len() len('abc')/len([1,2,3])/len((1,2,3,))  序列长度
divmod() divmod(5,2)  取模
 pow() pow(2,3,4)  相乘
round() round(1)  浮点数
 函数()    
 callable() callable(funcname)  判断函数是否可调用
 isinstance() isinstance(x,list/int)  类型判断
 cmp() cmp(x,y)  比较
 range()

range(1,5) #代表从1到5(不包含5)

http://www.cnblogs.com/buro79xxd/archive/2011/05/23/2054493.html

 生成序列
函数(类型转换)    
int(x)  a=int(b),把b转化为整型, 整型
long()   长整型
float(x)  a=float(b),把b转化为浮点型 浮点型

其他之后补充。。。。。。

原文地址:https://www.cnblogs.com/cxx1/p/7131918.html