Reference to Python Built-in Functions
In Python programming, built-in functions play a vital role in simplifying tasks and enhancing productivity. These functions come pre-installed with the language, ready to use without any additional setup. This guide provides a complete and updated list of all 70+ Python built-in functions, organized into categories based on their purpose.
Alphabetical Reference
The following table lists all 75 built-in Python functions in alphabetical order.
| 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 in an iterable are true. |
| anext() | Returns the next item from an asynchronous iterator. |
| any() | Returns True if any element in an iterable is true. |
| ascii() | Returns a string containing a printable representation, escaping non-ASCII chars. |
| bin() | Converts an integer to a binary string prefixed with 0b. |
| bool() | Converts a value to a Boolean, returning True or False. |
| breakpoint() | Inserts a breakpoint for debugging at the call site. |
| bytearray() | Creates a mutable sequence of bytes. |
| bytes() | Creates an immutable sequence of bytes. |
| callable() | Checks if an object appears callable (like a function). |
| chr() | Returns the character corresponding to a given Unicode code point integer. |
| classmethod() | Transforms a method into a class method. |
| compile() | Compiles source code into a code object for execution. |
| complex() | Creates a complex number from real and imaginary parts. |
| copyright() | Displays the Python copyright information. |
| credits() | Displays the Python credits. |
| delattr() | Deletes an attribute from an object. |
| dict() | Creates a new dictionary object. |
| dir() | Returns a list of attributes and methods of an object. |
| divmod() | Returns the quotient and remainder of division as a tuple. |
| enumerate() | Returns an iterator that yields pairs of index and value. |
| eval() | Evaluates and executes a Python expression. |
| exec() | Executes dynamically generated Python code. |
| exit() | Exits the interpreter by raising SystemExit. |
| filter() | Filters elements from an iterable based on a function. |
| float() | Converts a value to a floating-point number. |
| format() | Formats a value according to a format specifier. |
| frozenset() | Creates an immutable set from an iterable. |
| getattr() | Returns the value of a named attribute of an object. |
| globals() | Returns the global symbol table as a dictionary. |
| hasattr() | Checks if an object has a named attribute. |
| hash() | Returns the hash value of an object. |
| help() | Invokes the built-in help system. |
| hex() | Converts an integer to a hexadecimal string prefixed with 0x. |
| id() | Returns the identity of an object. |
| input() | Reads a line of input from the user. |
| int() | Converts a value to an integer. |
| isinstance() | Checks if an object is an instance of a class or tuple of classes. |
| issubclass() | Checks if a class is a subclass of another class or tuple of classes. |
| iter() | Returns an iterator from an iterable. |
| len() | Returns the length (number of items) of an object. |
| list() | Creates a new list from an iterable. |
| license() | Displays the Python license information. |
| locals() | Returns a dictionary of the current local symbol table. |
| map() | Applies a function to every item of an iterable and returns an iterator. |
| max() | Returns the largest item in an iterable or among arguments. |
| memoryview() | Creates a memory view object of a given argument. |
| min() | Returns the smallest item in an iterable or among arguments. |
| next() | Retrieves the next item from an iterator. |
| object() | Creates a new base object. |
| oct() | Converts an integer to an octal string prefixed with 0o. |
| open() | Opens a file and returns a corresponding file object. |
| ord() | Returns the Unicode code point of a character. |
| pow() | Returns the value of a number raised to a power. |
| print() | Prints objects to the standard output. |
| property() | Returns a property attribute. |
| quit() | Exits the interpreter by raising SystemExit. |
| range() | Returns an immutable sequence of numbers. |
| repr() | Returns a string representation of an object. |
| reversed() | Returns a reversed iterator over a sequence. |
| round() | Rounds a number to a given precision in decimal digits. |
| set() | Creates a new set object. |
| setattr() | Sets the value of a named attribute on an object. |
| slice() | Returns a slice object representing a set of indices. |
| sorted() | Returns a sorted list from the items in an iterable. |
| staticmethod() | Converts a method into a static method. |
| str() | Returns the string representation of an object. |
| sum() | Returns the sum of items in an iterable. |
| super() | Returns a proxy object to delegate method calls to a parent or sibling class. |
| tuple() | Creates a tuple, an immutable sequence. |
| type() | Returns the type of an object. |
| vars() | Returns the __dict__ attribute for an object. |
| zip() | Returns an iterator that aggregates elements from multiple iterables. |
Dynamically Get Python Built-in Functions
The Python standard library includes a collection of built-in functions available across all Python environments. Fortunately, you can dynamically retrieve the complete and up-to-date list of these built-in functions using the following code snippet.
Get Python Built-in Functions
# Get the list of built-in Python functions
import builtins
# Get only built-in functions, excluding exceptions (which start with uppercase)
builtin_functions = [
func for func in dir(builtins)
if callable(getattr(builtins, func))
and not func.startswith('__')
and func[0].islower() # only lowercase names (functions/types), excludes exceptions
]
print(builtin_functions)
['abs', 'aiter', 'all', 'anext', 'any', 'ascii', 'bin', 'bool', 'breakpoint', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']