Python built-in functions

The Python interpreter has a number of functions and types built into it that are always available.

Python built-in Functions

Function Description
abs() Return the absolute value of a number.
aiter() Return an asynchronous iterator for an asynchronous iterable.
all() Return True if all elements of the iterable are true.
any() Return True if any element of the iterable is true.
ascii() Return a string with a printable representation of an object.
bin() Convert an integer number to a binary string.
bool() Return a Boolean value.
breakpoint() Drops you into the debugger at the call site.
bytearray() Return a new array of bytes.
bytes() Return a new “bytes” object.
callable() Return True if the object argument is callable, False if not.
chr() Return the string representing a character.
classmethod() Transform a method into a class method.
compile() Compile the source into a code or AST object.
complex() Return a complex number with the value real + imag*1j.
delattr() Deletes the named attribute, provided the object allows it.
dict() Create a new dictionary.
dir() Return the list of names in the current local scope.
divmod() Return a pair of numbers consisting of their quotient and remainder.
enumerate() Return an enumerate object.
eval() Evaluates and executes an expression.
exec() This function supports dynamic execution of Python code.
filter() Construct an iterator from an iterable and returns true.
float() Return a floating point number from a number or string.
format() Convert a value to a “formatted” representation.
frozenset() Return a new frozenset object.
getattr() Return the value of the named attribute of object.
globals() Return the dictionary implementing the current module namespace.
hasattr() True if the string is the name of one of the object’s attributes.
hash() Return the hash value of the object.
help() Invoke the built-in help system.
hex() Convert an integer number to a lowercase hexadecimal string.
id() Return the “identity” of an object.
input() This function takes an input and converts it into a string.
int() Return an integer object constructed from a number or string.
isinstance() Return True if the object argument is an instance of an object.
issubclass() Return True if class is a subclass of classinfo.
iter() Return an iterator object.
len() Return the length (the number of items) of an object.
list() Rather than being a function, list is a mutable sequence type.
locals() Update and return a dictionary with the current local symbol table.
map() Return an iterator that applies function to every item of iterable.
max() Return the largest item in an iterable.
min() Return the smallest item in an iterable.
next() Retrieve the next item from the iterator.
object() Return a new featureless object.
oct() Convert an integer number to an octal string.
open() Open file and return a corresponding file object.
ord() Return an integer representing the Unicode code point of a character.
pow() Return base to the power exp.
print() Print objects to the text stream file.
property() Return a property attribute.
repr() Return a string containing a printable representation of an object.
reversed() Return a reverse iterator.
round() Return number rounded to ndigits precision after the decimal point.
set() Return a new set object.
setattr() This is the counterpart of getattr().
slice() Return a sliced object representing a set of indices.
sorted() Return a new sorted list from the items in iterable.
staticmethod() Transform a method into a static method.
str() Return a str version of object.
sum() Sums start and the items of an iterable.
super() Return a proxy object that delegates method calls to a parent or sibling.
tuple() Rather than being a function, is actually an immutable sequence type.
type() Return the type of an object.
vars() Return the dict attribute for any other object with a dict attribute.
zip() Iterate over several iterables in parallel.
**import**() This function is invoked by the import statement.

Python abs() built-in function Python aiter() built-in function Python all() built-in function Python any() built-in function Python ascii() built-in function Python bin() built-in function Python bool() built-in function Python breakpoint() built-in function Python bytearray() built-in function Python bytes() built-in function Python callable() built-in function Python chr() built-in function Python classmethod() built-in function Python compile() built-in function Python complex() built-in function Python delattr() built-in function Python dict() built-in function Python dir() built-in function Python divmod() built-in function Python enumerate() built-in function Python eval() built-in function Python exec() built-in function Python filter() built-in function Python float() built-in function Python format() built-in function Python frozenset() built-in function Python getattr() built-in function Python globals() built-in function Python hasattr() built-in function Python hash() built-in function Python help() built-in function Python hex() built-in function Python id() built-in function Python __import__() built-in function Python input() built-in function Python int() built-in function Python isinstance() built-in function Python issubclass() built-in function Python iter() built-in function Python len() built-in function Python list() built-in function Python locals() built-in function Python map() built-in function Python max() built-in function Python memoryview() built-in function Python min() built-in function Python next() built-in function Python object() built-in function Python oct() built-in function Python open() built-in function Python ord() built-in function Python pow() built-in function Python print() built-in function Python property() built-in function Python range() built-in function Python repr() built-in function Python reversed() built-in function Python round() built-in function Python set() built-in function Python setattr() built-in function Python slice() built-in function Python sorted() built-in function Python staticmethod() built-in function Python str() built-in function Python sum() built-in function Python super() built-in function Python tuple() built-in function Python type() built-in function Python vars() built-in function Python zip() built-in function