Skip to main content

Built-In Functions

This website's section is dedicated to Python's built-in functions and provides essential insights into the core functionalities readily available within the language. Each function comes equipped with a distinct purpose, efficiently catering to a variety of programming needs. Through clear descriptions and illustrative examples, this resource offers users a comprehensive understanding of Python's built-in capabilities.

Function Description
abs()

The abs() function in Python is a built-in function that returns the absolute value of a number.

aiter()

The aiter() function in Python returns an asynchronous iterator object for an asynchronous iterable.

all()

The all() function in Python returns True if all elements in the iterable are true. If the iterable is empty, it will return True.

anext()

The anext() function is used to advance an asynchronous iterator by one step.

any()

The any() function in Python returns True if any element in the iterable passed as argument is True.

ascii()

The ascii() function returns a string containing a printable representation of an object, escaping the non-ASCII characters using \x, \u or \U escapes.

bin()

The bin() function is a built-in Python function that converts an integer number into a binary string prefixed with '0b'.

bool()

The bool() function in Python is a built-in function that returns the boolean value of a specified object.

breakpoint()

The breakpoint() function is a Python built-in function that can be used as a debugging aid.

bytearray()

The bytearray() function in Python creates a new mutable bytearray object.

bytes()

The bytes() function in Python returns a new 'bytes' object which is an immutable sequence of integers in the range 0 <= x < 256.

callable()

A built-in function that returns True if the specified object appears callable (i.e., can be called as a function), and False otherwise.

chr()

The chr() function in Python returns the character that represents the Unicode code point passed as an argument.

classmethod()

The classmethod() function in Python returns a class method for the given function.

compile()

The compile() function in Python is a built-in function that is used to compile the source into a code or AST object.

complex()

The complex() function in Python is a built-in function that returns a complex number by specifying a real part and an optional imaginary part.

delattr()

The delattr() function is a built-in function in Python that deletes the named attribute from the specified object.

dict()

The dict() function in Python returns a new dictionary object.

dir()

The dir() function in Python returns a list of valid attributes and methods for the specified object.

divmod()

The divmod() function in Python returns a tuple containing the quotient and the remainder when dividing two numbers.

enumerate()

The enumerate() function in Python is a built-in function that allows you to loop over an iterable object while also keeping track of the index of the current item.

eval()

The eval() function in Python evaluates and executes a Python expression dynamically.

exec()

The exec() function in Python is a built-in function that dynamically executes Python code.

filter()

The filter() function in Python is a built-in function used to filter elements from an iterable (such as a list) for which a provided function returns true.

float()

The float() function in Python converts a number or a string that represents a floating-point number to a floating-point number.

format()

The format() function is a built-in function in Python used for string formatting.

frozenset()

The frozenset() function in Python creates an immutable set. It takes an iterable object as an optional parameter and returns a frozenset object with the elements of the iterable.

getattr()

The getattr() function in Python is a built-in function that is used to get the value of a specified attribute from an object.

globals()

The globals() function in Python returns a dictionary representing the current global symbol table.

hasattr()

The hasattr() function in Python is a built-in function that returns True if the specified object has the given attribute, and False if not.

hash()

The hash() function in Python is a built-in function that returns the hash value of an object.

help()

The help() function in Python is a built-in function that is used to display information about a specific object, module, function, class, or method.

hex()

The hex() function in Python is a built-in function that converts an integer number into a lowercase hexadecimal string prefixed with '0x'.

id()

Return the id of an object. This is a unique identifier assigned to every object in Python.

input()

The input() function in Python is a built-in function that reads a line from the input (usually from the user) and returns it as a string.

int()

The int() function in Python is a built-in function that converts a specified value into an integer number.

isinstance()

The isinstance() function in Python is a built-in function used to check if an object is an instance of a specified class.

issubclass()

The issubclass() function in Python is a built-in function that returns True if the first argument is a subclass of the second argument.

iter()

The iter() function in Python is a built-in function that returns an iterator object from an iterable.

len()

The len() function in Python is a built-in function that returns the number of items in a container, such as a string, list, tuple, dictionary, etc.

list()

The list() function in Python is a built-in function used to create a new list object.

locals()

The locals() function in Python returns a dictionary containing the current local symbol table.

map()

The map() function in Python is a built-in function that takes a function and an iterable (like a list) as arguments.

max()

The max() function in Python is a built-in function that returns the highest value among the arguments passed to it.

memoryview()

The memoryview() function in Python returns a memory view object that exposes the internal data of an object in a memory-efficient way.

min()

The min() function in Python is a built-in function that returns the smallest item in an iterable (such as a list, tuple, or string) or among multiple arguments.

next()

The next() function is a built-in Python function that retrieves the next item from an iterator by calling its __next__() method.

object()

The object() function returns a new featureless object without any methods or properties.

oct()

The oct() function is a built-in Python function that takes an integer as an argument and returns its octal representation as a string.

open()

The open() function in Python is a built-in function used to open a file and return a corresponding file object.

ord()

The ord() function in Python is a built-in function that returns the Unicode code point of a character passed as an argument.

pow()

The pow() function in Python is a built-in function that is used to calculate the power of a number.

print()

The print() function in Python is a built-in function used to display the specified content, such as variables, strings, or numbers, on the output screen.

property()

The property() function in Python creates and returns a property object.

range()

The range() function in Python is a built-in function that generates a sequence of numbers. It can take up to three arguments - start, stop, and step. By default, it starts at 0 and increments by 1.

repr()

The repr() function in Python returns a string representation of the object.

reversed()

The reversed() function is a built-in function in Python that returns a reverse iterator for a sequence.

round()

A built-in function that returns the floating-point number rounded to a specified number of digits after the decimal point. It takes two arguments: the number to be rounded and the number of digits to round to.

set()

The set() function in Python is a built-in function that creates a set object, which is an unordered collection of unique elements.

setattr()

The setattr() function in Python is a built-in function that sets the attribute of a given object.

slice()

The slice() function in Python returns a slice object that represents a section of a sequence (such as a list, string, or tuple).

sorted()

The sorted() function in Python is a built-in function used to sort iterables such as lists, tuples, and strings.

staticmethod()

The staticmethod() function in Python returns a static method for a given function.

str()

The str() function in Python is a built-in function that converts the specified value into a string.

sum()

The sum() function is a built-in function in Python that takes an iterable (such as a list) of numbers as input and returns the sum of all the numbers in the iterable.

super()

The super() function is a built-in function in Python that returns a temporary object of the superclass (parent class) of the given object.

tuple()

The tuple() function in Python is a built-in function that creates a tuple object.

type()

The type() function in Python is a built-in function used to get the type of an object.

vars()

The vars() function returns the __dict__ attribute of the given object.

zip()

The zip() function in Python returns an iterator that aggregates elements from two or more iterables (such as lists, tuples, etc.) into tuples.