Python built-in functions

Python has a set of built-in functions.

Function Description
abs() Return the absolute value of the number
all() Return True if all items in the iterable are true.
any() Return True if any item in the iterable is true.
ascii() Return the readable version of the object. Replace none-ascii characters with escape characters.
bin() Return the binary version of the number.
bool() Return the boolean value of the specified object.
bytearray() Return a byte array.
bytes() Return a byte object.
callable() Return True if the specified object is callable, otherwise return False.
chr() Return the character in the specified Unicode code.
classmethod() Convert the method to a class method.
compile() 把指定的源作为对象返回,准备执行。
complex() 返回复数。
delattr() 从指定的对象中删除指定的属性(属性或方法)。
dict() 返回字典(数组)。
dir() 返回指定对象的属性和方法的列表。
divmod() 当参数1除以参数2时,返回商和余数。
enumerate() 获取集合(例如元组)并将其作为枚举对象返回。
eval() 评估并执行表达式。
exec() 执行指定的代码(或对象)。
filter() 使用过滤器函数排除可迭代对象中的项目。
float() 返回浮点数。
format() 格式化指定值。
frozenset() 返回 frozenset 对象。
getattr() 返回指定属性的值(属性或方法)。
globals() 以字典返回当前全局符号表。
hasattr() 如果指定的对象拥有指定的属性(属性/方法),则返回 True。
hash() 返回指定对象的哈希值。
help() 执行内建的帮助系统。
hex() 把数字转换为十六进制值。
id() 返回对象的 id。
input() 允许用户输入。
int() 返回整数。
isinstance() 如果指定的对象是指定对象的实例,则返回 True。
issubclass() 如果指定的类是指定对象的子类,则返回 True。
iter() 返回迭代器对象。
len() 返回对象的长度。
list() 返回列表。
locals() 返回当前本地符号表的更新字典。
map() 返回指定的迭代器,其中指定的函数应用于每个项目。
max() 返回可迭代对象中的最大项目。
memoryview() 返回内存视图(memory view)对象。
min() 返回可迭代对象中的最小项目。
next() 返回可迭代对象中的下一项。
object() 返回新对象。
oct() 把数转换为八进制。
open() 打开文件并返回文件对象。
ord() 转换表示指定字符的 Unicode 的整数。
pow() 返回 x 的 y 次幂的值。
print() 打印标准输出设备。
property() 获取、设置、删除属性。
range() Geef een getallenreeks terug, die begint bij 0 en met een verhooging van 1 (standaard).
repr() Geef een leesbare versie van het object terug.
reversed() Geef een gekeerde iterator terug.
round() Rond het logaritme af.
set() Geef een nieuwe set object terug.
setattr() Stel de eigenschap (eigenschap/methode) van het object in.
slice() Geef een slice object terug.
sorted() Geef een gesorteerde lijst terug.
@staticmethod() Zet de methode om in een statische methode.
str() Geef een stringobject terug.
sum() Voer de som uit van de items van de iterator.
super() Geef een object dat de ouders van de klasse vertegenwoordigt terug.
tuple() Geef een tuple terug.
type() Geef het type van het object terug.
vars() Geef de __dict__ eigenschap van het object terug.
zip() Geef een iterator terug van twee of meerdere iteratoren.