python内建函数【from官方文档】

  Built-in Functions  
abs() divmod() input() open() staticmethod()
all() enumerate() int() ord() str()
any() eval() isinstance() pow() sum()
basestring() execfile() issubclass() print() super()
bin() file() iter() property() tuple()
bool() filter() len() range() type()
bytearray() float() list() raw_input() unichr()
callable() format() locals() reduce() unicode()
chr() frozenset() long() reload() vars()
classmethod() getattr() map() repr() xrange()
cmp() globals() max() reversed() zip()
compile() hasattr() memoryview() round() __import__()
complex() hash() min() set() apply()
delattr() help() next() setattr() buffer()
dict() hex() object() slice() coerce()
dir() id() oct() sorted() intern()

官方文档给出了上述X种内建函数,看看都实现什么功能:

1)abs(X)

参数:X

功能:求X的绝对值

返回值:X的绝对值

2)all(iterable)

参数:iterable

功能:所有值为true,返回true;否则或者Null,返回False

返回值:True/False

3)any(iterable)

参数:iterable

功能:若有值为true,返回true;否则或者Null,返回False

返回值:True/False

4)basestring()

参数:iterable

功能:是 strunicode  的superclass

返回值:True/False

5)bin(X)

参数:X

功能:将integer数值转换成二进制string

返回值:如果X不是int的object,则必须定义一个 __index__()返回一个 integer.

原文地址:https://www.cnblogs.com/xiami303/p/2528847.html