Python is one of the most popular programming languages in the world, thanks in large part to its simple syntax, versatility, and vast array of built-in functions. These functions can save you time and effort by providing pre-written code for a variety of common tasks. In this article, we will provide a comprehensive list of Python’s built-in functions. Click on the respective function name to know more details about their description, syntax, and examples.
List of Python Built-in Functions:
Function Name | 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. otherwise Returns False. |
any() | Returns true if any element of the iterable is true. Returns false if the iterable is empty. |
anext() | Returns 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 replaces the non-ascii characters in the string with \x, \u, or \u escapes. |
bin() | Converts an integer number to a binary string. |
bool() | Returns a boolean value either true or false. |
breakpoint() | This function drops you into the debugger at the call site. |
bytearray() | Returns an array of bytes. |
bytes() | Returns a new bytes object which is an immutable sequence of integers. |
callable() | Returns true if the specified object is callable, otherwise Returns false. |
chr() | Returns the string representing a character whose unicode code point is the integer. |
classmethod() | Transforms or changes a method into a class method. |
compile() | Compile the source into python code or abstract syntax tree(ast) object. AST code directly interact with python code and modify them. |
complex() | Returns a complex number or convert a string or number to a complex number. |
delattr() | Deletes the named attribute from the specified object. |
dict() | Creates a new dictionary. |
dir() | Returns a list of the attributes and methods of any object. |
divmod() | Takes any two numbers as arguments and returns their quotient and remainder when using integer division. |
enumerate() | Returns an enumerate object. |
eval() | Evaluates and executes a python expression argument is parsed. |
exec() | Supports dynamic execution of python code. |
filter() | Filters the specified sequence with the help of the filter function that tests each element in an iterable to be true or not. |
float() | Returns a floating point number constructed from a number or string. |
format() | Converts a value to a formatted or specified representation. |
frozenset() | Returns a new frozenset object. |
getattr() | Returns the value of the named attribute of object. Name must be a string data type. |
globals() | Returns the dictionary of the current global symbol table as a dictionary. |
hasattr() | Returns true if the specified object has the specified named attribute. Otherwise Returns false. |
hash() | Returns the hash value of the object. |
help() | Invokes or calls the built-in help system. |
hex() | Converts a specified integer number into a lowercase hexadecimal value. |
id() | Returns the identity of an object. |
input() | Takes an input from the user and Converts it to a string. |
int() | Returns an integer number. |
isinstance() | Returns true if specified object is an instance of that object, otherwise Returns false. |
issubclass() | Returns true if specified class is a subclass of specified object, otherwise Returns false. |
iter() | Returns an iterator object. |
len() | Returns the length of an object. |
list() | Creates a list in python. |
locals() | Updates and Returns the dictionary of the current local symbol table. |
map() | Returns the largest item in an an iterable object. |
max() | Returns the largest item in an iterable or the largest of two or more arguments. |
memoryview() | Returns a memory view object created from the given argument. |
min() | Returns the smallest element from the collection or the smallest of two or more arguments. |
next() | Returns the next item from the iterator. |
object() | Returns a new featureless object |
oct() | Converts an integer number to an octal string prefixed with ‘0o’. |
open() | Opens a file and Returns a corresponding file object. |
ord() | Returns an integer which represents the unicode code point of that character. |
pow() | Returns base to the power exp. |
print() | Print objects or output to the text stream file. |
property() | Returns a property attribute. |
range() | Returns a sequence of numbers starting from 0, increments by 1 and ends at a specified number. |
repr() | Returns a string containing a printable representation of an object. |
reversed() | Returns a reverse iterator. |
round() | Returns the nearest integer to its input rounded to the given number after the decimal point. |
set() | Returns a new set object, optionally with elements taken from iterable. it is a built-in class. |
setattr() | Sets an object attribute. |
slice() | Returns a slice object representing the set of indices specified by a range(start, stop, step). |
sorted() | Returns a new sorted list from the items in iterable. |
staticmethod() | Converts a method into a static method. |
str() | Returns a string version of object. |
sum() | Sums up the numbers in the list or an iterable. |
super() | Returns an object that represents a parent class or sibling class of type. |
tuple() | Returns a tuple which is an immutable sequence type. |
type() | Returns the type of an object. |
vars() | Returns the __dict__ attribute for a module, class, instance, or any other object with a __dict__ attribute. |
zip() | Returns an iterator, and maps the similar index of multiple containers. |
__import__() | Imports the module during runtime. |