Python Built-in Functions

The Python interpreter has a set of functions built into it that are always available. These functions are called built-in functions. It is worthy to be aware of what all the built-ins roughly do, so you could learn more about them when you need to, thus preventing unnecessary work. In this page, you will find all the built-in functions in Python.

Built-in Function Description
abs() Returns the absolute value of a number.
aiter() Returns an asynchronous iterator for an asynchronous iterable.
all() Returns True if all elements of the iterable are true (or if the iterable is empty).
any() Returns True if any element of the iterable is true.
anext() When awaited, return the next item from the given asynchronous iterator, or default if given and the iterator is exhausted.
ascii() Returns a string containing a printable representation of an object, but escape the non-ASCII characters in the string
bin() Converts an integer number to a binary string prefixed with “0b”.
bool() Returns a Boolean value - True or False.
breakpoint() Drops into the debugger at the call site.
bytearray() Returns a new array of bytes.
bytes() Returns a new "bytes" object which is an immutable sequence of integers.
callable() Returns True if the object argument appears callable, False if not.
chr() Returns the string representing a character whose Unicode is the integer
classmethod() Transforms a method into a class method.
compile() Compiles the source into a code.
complex() Returns a complex number.
dict() Creates a new dictionary.
dir() Returns the list of names in the current local scope.
divmod() Takes two numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division.
enumerate() Returns an enumerate object.
eval() Evaluates and executes an expression
filter() Constructs an iterator from those elements of iterable for which function returns true.
float() Returns a floating point number constructed from a number or string
format() Converts a value to a “formatted” representation
frozenset() Returns a new frozenset object
getattr() Returns the value of the named attribute of object.
globals() Returns the dictionary implementing the current module namespace.
hasattr() The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not.
hash() Returns the hash value of the object.
help() Prints the documentation of the object.
hex() Converts an integer number to a hexadecimal string.
id() Returns the “identity” of an object.
input() Get input from the user.
int() Returns an integer object.
isinstance() Returns True if a the object is an instance of a specified object.
issubclass() Returns True if class is a subclass of a specified one.
iter() Returns an iterator object.
len() Returns the length of an object.
list() Creates a new list.
locals() Updates and return a dictionary representing the current local symbol table.
map() Returns an iterator that applies function to every item of iterable, yielding the results.
max() Returns the largest item in an iterable.
memoryview() Returns a “memory view” object.
min() Returns the smallest item in an iterable.
next() Returns the next item in an iterable.
object() Returns a new object.
oct() Converts an integer number to an octal string.
open() Open file and return a corresponding file object..
ord() Returns an integer representing the Unicode code point of a character.
pow() Returns the power.
print() Prints an object.
property() Returns a property attribute.
range() Returns a range object.
repr() Returns a textual representation of an object.
reversed() Returns a reverse iterator.
round() Returns number rounded to ndigits precision after the decimal point.
set() Returns a new set object
slice() Returns a slice object.
sorted() Returns a new sorted list from the items in iterable.
staticmethod() Transforms a method into a static method.
str() Returns a str version of object.
sum() Sums start and the items of an iterable.
super() Returns a object that represents the base class.
tuple() Creates a tuple.
type() Returns the type of an object.
vars() Returns the dict attribute
zip() Iterates over several iterables in parallel, producing tuples with an item from each one.