Python’s Built-in Functions

Python built-in functions are a set of core functions that are readily available for use in any Python program without needing to import any external libraries.

These functions provide basic functionalities, ranging from simple data manipulation to advanced operations, making Python an efficient and versatile programming language.

  • abs() Returns a number’s absolute value, which is its distance from zero, regardless of its sign.
  • aiter() Returns an asynchronous iterator for the provided asynchronous iterable.
  • all() Returns True if all the items in an iterable are truthy and False otherwise.
  • anext() Returns the next item from the provided asynchronous iterator.
  • any() Returns True if at least one element in the iterable is truthy and False otherwise.
  • ascii() Returns a string representation of the input object with non-ASCII characters escaped.
  • bin() Returns a string representing the binary equivalent of the given integer prefixed with “0b”.
  • bool() Returns the truth value of any Python object as a Boolean value (True or False).
  • breakpoint() Calls pdb.set_trace(), entering an interactive debugging session.
  • callable() Returns True if the input object is callable and False otherwise.
  • chr() Returns a string that represents the character associated with the given Unicode code point.
  • classmethod() Returns a class method object that can be called on both the class and its instances.
  • compile() Returns a code object that can be executed using exec() or evaluated with eval().
  • delattr() Deletes the specified attribute from the input object.
  • dir() Returns a list of names in the current local scope or the list of attributes and methods of a given object.
  • divmod() Returns a tuple containing the quotient and remainder from an integer division.
  • enumerate() Returns an enumerate object that yields pairs of count and value from the iterable.
  • eval() Returns the result of evaluating an expression from a string or compiled code object.
  • exec() Executes code provided as either a string or a compiled code object.
  • filter() Returns a filter object that yields those elements of iterable for which the filtering function returns True.
  • format() Returns a formatted string representation of the input value according to the specified format.
  • getattr() Returns the value of an attribute from an object.
  • globals() Returns a dictionary representing the current global symbol table.
  • hasattr() Returns True if the object has the specified attribute or method and False otherwise.
  • hash() Returns an integer that represents the hash value of the given object.
  • help() Opens the interactive help utility or prints the help page for the specified object.
  • hex() Returns a string holding the hexadecimal representation of the input integer, prefixed with “0x”.
  • id() Returns an integer representing the identity of the input object.
  • __import__() Returns the top-level package or module specified by name.
  • input() Returns the user input as a string, regardless of the input type.
  • isinstance() Returns True if the input object is an instance of a given class, and False otherwise.
  • issubclass() Returns True if its first argument is a subclass of its second argument and False otherwise.
  • iter() Returns an iterator object that can traverse the elements of the iterable.
  • len() Returns an integer representing the number of items in the input object.
  • locals() Returns a dictionary representing the current local symbol table with variable names as keys and their corresponding values.
  • map() Returns a map object that generates items by applying a transformation function to every item of the input iterable or iterables.
  • max() Returns the largest value in an iterable or series of arguments.
  • memoryview() Returns a memoryview object, which allows for efficient access to the data without copying it.
  • min() Returns the smallest value in an iterable or series of arguments.
  • next() Returns the next item from an iterator.
  • oct() Returns a string holding the octal representation of the input integer prefixed with “0o”.
  • open() Returns a file object whose type and allowed actions depend on the specified mode.
  • ord() Returns an integer representing the Unicode code point of the character.
  • pow() Returns the power of a given base raised to a specific exponent.
  • print() Displays data as text on the screen or writes data into a file object.
  • property() Returns a property object that allows controlled access and mutation of an instance attribute.
  • repr() Returns a string that is a developer-friendly representation of the input object.
  • reversed() Returns an iterator that yields the elements of the input iterable in reverse order.
  • round() Returns a number rounded to the specified number of decimal places.
  • setattr() Modifies the input object by setting the specified attribute to the given value.
  • slice() Returns a slice object that can be used to extract a portion of a sequence.
  • sorted() Returns a new sorted list of the elements in the iterable.
  • staticmethod() Returns a static method object that can be called on a class or its instances.
  • sum() Returns the sum of the start value and the values in the input iterable from left to right.
  • super() Returns a proxy object that delegates method calls to a parent or sibling class of the specified type.
  • type() Returns the type of the input object or a new class object.
  • vars() Returns a dictionary representing an object’s namespace or a dictionary of the local namespace similar to locals().
  • zip() Returns an iterator of tuples, where the i-th tuple contains the i-th element from each of the argument iterables.