python的内建函数built-in functions




之前将关键字和内建函数给弄混淆了,现在系统的总结一下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 True 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 == yand strictly positive if x > y.

compile()

complex()

delattr()

dict() 创造一个字典类型

dir()




posted @ 2022-03-06 10:39  叶常落  阅读(87)  评论(0编辑  收藏  举报