
python的内建函数built-in functions
发布日期:2021-05-07 18:06:36
浏览次数:18
分类:精选文章
本文共 650 字,大约阅读时间需要 2 分钟。
之前将关键字和内建函数给弄混淆了,现在系统的总结一下python2.7内建函数。
abs() 绝对值
all()可迭代对象都为真
any()可迭代对象任意一个为真
basestring() 不可直接调用的 isinstance(obj, basestring)
is equivalent to isinstance(obj, (str, unicode))
.
bin() Convert an integer number to a binary string(将整型转化为二进制字符)
bool() 返回布尔值True or False
bytearray
callable() Return if the object argument appears callable
chr(i) Return a string of one character whose ASCII code is the integer i
classmethod
cmp(x,y) Compare the two objects x and y and return an integer according to the outcome. The return value is negative if x < y
, zero if x == y
and strictly positive if x > y
.
compile()
complex()
delattr()
dict() 创造一个字典类型
dir()