function | Features |
---|---|
abs(x) | It returns a positive number. Parameter may be an integer or floating point number. If the parameter is a complex number, it returns the mold. |
all(iterable) | If all the elements of iterable is true (or iterator is empty) and returns True |
any(iterable) | If any element of iterable is true returns True. If the iterator is empty, returns False |
ascii(object) | Returns a string representation of an object |
am (x) | An integer into a prefix "0b" binary string |
bool([x]) | It returns a Boolean value, True or False. |
breakpoint(*args, **kws) | This function will call into your site's debugger |
bytearray([source[, encoding[, errors]]]) | Returns a new array of bytes |
bytes([source[, encoding[, errors]]]) | Returns a new "bytes" Object |
callable(object) | If the parameter object can be called, returns True, otherwise False |
char(i) | Returns the Unicode code of a character string format for integer i |
@classmethod | The method of packaging into a class method |
compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1) | Source code or compiled into an object AST |
complex([real[, imag]]) | The return value is real + imag * 1j complex, or converted into a complex number or string |
delattr(object, name) | If the object allows the function to delete the specified attribute |
dict(**kwarg) dict(mapping, **kwarg) dict(iterable, **kwarg) |
Create a new dictionary |
dir([object]) | If there is no argument, list the name of the current local scope is returned. If there are arguments, it tries to return a list of valid property of the object |
divmod(a, b) | It two (non-complex) number as an argument and returns the quotient and remainder of a pair of performing integer division |
enumerate(iterable, start=0) | Returns an enumerable object |
eval(expression[, globals[, locals]]) | The return value is the result of the expression evaluation |
exec (object [, global [, locals]]) | It must be a string or object code objects. If a string, the string will be interpreted as a series of statements and execute Python (unless a syntax error occurs). If a code object, it will be directly executed |
filter(function, iterable) | Filtered sequence, to filter out iterable ineligible element, function as a condition to return a new list of eligible elements of |
float([x]) | And the floating point number or a string generated from x |
format(value[, format_spec]) | The control value is converted to format_spec "Format" indicates |
frozenset([iterable]) | Frozenset returns a new object that contains the elements of optional parameters iterable |
getattr(object, name[, default]) | Returns the value of an attribute object naming |
globals() | Returns a dictionary of current global symbol table |
hasattr(object, name) | If the string is the name of one of the properties of an object, it returns True, otherwise False |
hash(object) | Return the hash value of the object (if it has one) |
help([object]) | Start the built-in help system |
hex(x) | Convert integer with "0x" prefix lowercase hexadecimal string |
id(object) | Returns the object "Identifying value" |
input([prompt]) | Accepts a standard input data |
int([x]) int(x, base=10) |
Returns a String or an Integer object-based digital x configuration, or returns 0 when the parameter is not given |
isinstance(object, classinfo) | 如果参数 object 是参数 classinfo 的实例或者是其 (直接、间接或 虚拟) 子类则返回 True。 如果 object 不是给定类型的对象,函数将总是返回 False |
issubclass(class, classinfo) | 如果 class 是 classinfo 的 (直接、间接或 虚拟) 子类则返回 True |
iter(object[, sentinel]) | 返回一个 iterator(迭代器) 对象 |
len(s) | 返回对象的长度(元素个数) |
list([iterable]) | 将可迭代对象(字符串、列表、元祖、字典)转换为列表 |
locals() | 更新并返回表示当前本地符号表的字典 |
map(function, iterable, …) | 根据提供的函数对指定序列做映射 |
max(iterable, *[, key, default]) max(arg1, arg2, *args[, key]) |
返回可迭代对象中最大的元素,或者返回两个及以上实参中最大的 |
memoryview(obj) | 返回由给定实参创建的“内存视图”对象 |
min(iterable, *[, key, default]) min(arg1, arg2, *args[, key]) |
返回可迭代对象中最小的元素,或者返回两个及以上实参中最小的 |
next(iterator[, default]) | 通过调用 iterator 的 __next__() 方法获取下一个元素。如果迭代器耗尽,则返回给定的 default,如果没有默认值则触发 StopIteration |
object | 返回一个没有特征的新对象, object 是所有类的基类 |
oct(x) | 将一个整数转变为一个前缀为“0o”的八进制字符串 |
open(file, mode=‘r’, buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) | 打开 file 并返回对应的 file object。如果该文件不能打开,则触发 OSError |
ord© | 对表示单个 Unicode 字符的字符串,返回代表它 Unicode 码点的整数 |
pow(base, exp[, mod]) | 返回 base 的 exp 次幂;如果 mod 存在,则返回 base 的 exp 次幂对 mod 取余 |
print(*objects, sep=’ ‘, end=’\n’, file=sys.stdout, flush=False) | 将 objects 打印到 file 指定的文本流,以 sep 分隔并在末尾加上 end |
property(fget=None, fset=None, fdel=None, doc=None) | 返回 property 属性 |
range(stop) range(start, stop[, step]) |
返回不可变的序列 |
repr(object) | 返回包含一个对象的可打印表示形式的字符串 |
reversed(seq) | 返回一个反向的 iterator(迭代器) |
round(number[, ndigits]) | 返回 number 舍入到小数点后 ndigits 位精度的值 |
set([iterable]) | 返回一个新的 set 对象,可以选择带有从 iterable 获取的元素 |
setattr(object, name, value) | 设置属性值 |
slice(stop) slice(start, stop[, step]) |
返回一个表示由 range(start, stop, step) 所指定索引集的 slice 对象 |
sorted(iterable, *, key=None, reverse=False) | 根据 iterable 中的项返回一个新的已排序列表 |
@staticmethod | 将方法转换为静态方法 |
str(object=’’) str(object=b’’, encoding=‘utf-8’, errors=‘strict’) |
返回一个 str 版本的 object |
sum(iterable, /, start=0) | 从 start 开始自左向右对 iterable 的项求和并返回总计值 |
super([type[, object-or-type]]) | 调用父类(超类) |
tuple([iterable]) | 返回一个不可变的序列 |
type(object) type(name, bases, dict) |
传入一个参数时,返回 object 的类型 |
vars([object]) | 返回模块、类、实例或任何其它具有 __dict__ 属性的对象的 __dict__ 属性 |
zip(*iterables) | 创建一个聚合了来自每个可迭代对象中的元素的迭代器 |
__import__(name, globals=None, locals=None, fromlist=(), level=0) | 动态加载类和函数 |
Python built-in functions Issue
Guess you like
Origin blog.csdn.net/Jairoguo/article/details/104137704
Recommended
Ranking