Python Built-in Functions

Python provides a wide range of built-in functions that are always available for use. These functions perform basic tasks and are an essential part of the Python language.

Function Description
abs() Returns the absolute value of a number.
all() Returns True if all elements in an iterable are true.
any() Returns True if any element in an iterable is true.
bin() Converts an integer to a binary string.
bool() Converts a value to a Boolean.
bytearray() Returns a bytearray object.
bytes() Returns a bytes object.
callable() Checks if the object appears callable.
chr() Returns a string representing a character's Unicode code point.
compile() Compiles source into a code or AST object.
complex() Creates a complex number.
delattr() Deletes an attribute from an object.
dict() Creates a new dictionary.
dir() Attempts to return a list of valid attributes of the object.
divmod() Returns a pair of numbers consisting of their quotient and remainder.
enumerate() Returns an enumerate object containing index and value pairs.
eval() Evaluates and executes a Python expression.
filter() Constructs an iterator from elements of an iterable for which a function returns true.
float() Converts a number or string to a float.
format() Returns a formatted representation of a value.
frozenset() Returns a new frozenset object.
getattr() Returns the value of the named attribute of an object.
globals() Returns a dictionary representing the current global symbol table.
hasattr() Returns True if the object has the specified attribute.
hash() Returns the hash value of an object.
help() Invokes the built-in help system.
hex() Converts an integer to a hexadecimal string.
id() Returns the identity of an object.
input() Reads a line from input and returns it as a string.
int() Converts a number or string to an integer.
isinstance() Checks if an object is an instance or subclass of a class.
issubclass() Checks if a class is a subclass of another class.
len() Returns the length of an object.
list() Creates a list from an iterable.
locals() Returns an updated dictionary of the current local symbol table.
map() Applies a function to every item of an iterable and returns a list of the results.
max() Returns the largest item in an iterable.
min() Returns the smallest item in an iterable.
next() Retrieves the next item from an iterator.
object() Returns a new featureless object.
oct() Converts an integer to an octal string.
open() Opens a file and returns a file object.
ord() Returns the Unicode code point of the given character.
pow() Returns the value of x raised to the power of y.
print() Prints objects to the text stream file.
property() Returns a property attribute.
range() Returns an immutable sequence of numbers, commonly used for looping.
repr() Returns a string representation of an object that is readable.
reversed() Returns a reversed iterator over a sequence.
round() Rounds a floating-point number to a specified number of decimal places.
set() Creates a new set object.
setattr() Sets the value of an attribute of an object.
slice() Returns a slice object that can be used to slice sequences.
sorted() Returns a new sorted list from the items in an iterable.
staticmethod() Returns a static method for a class.
str() Converts an object to a string.
sum() Returns the sum of all items in an iterable.
super() Returns a proxy object that represents the parent classes.
tuple() Creates a tuple from an iterable.
type() Returns the type of an object or creates a new type object.
vars() Returns the __dict__ attribute of an object, which is a dictionary representing its attributes.
zip() Returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument iterables.
__import__() Import a module.