Python Builtin Functions

Builtin Functions

Python core library provides some builtin functions for the most trivial actions.

The following list of tutorials cover all the builtin functions in Python programming language.

  • abs()This function is used to find the absolute value of the given number. The tutorial contains syntax, and examples for abs() function.
  • all()This function is used to check if all the items in the given iterable are True. The tutorial contains syntax, and examples for all() function.
  • any()This function is used to check if any of  the items in the given iterable is True. The tutorial contains syntax, and examples for any() function.
  • ascii()This function escapes the non-ascii characters in the given object, and returns a printable version. The tutorial contains syntax, and examples for ascii() function.
  • bin()This function returns binary value of given integer. The tutorial contains syntax, and examples for bin() function.
  • bool()This function returns a boolean value of the given object. The tutorial contains syntax, and examples for bool() function.
  • bytearray()This function creates and returns a byte array of specific size, or with the contents of specified string object and encoding. The tutorial contains syntax, and examples for bytearray() function.
  • bytes()This function creates and returns a bytes object of specific size, or with the contents of specified string object and encoding. The tutorial contains syntax, and examples for bytes() function.
  • callable()This function returns True if given object is callable, or False otherwise. The tutorial contains syntax, and examples for callable() function.
  • chr()This function returns the character specified by the given Unicode code point. The tutorial contains syntax, and examples for chr() function.
  • @classmethod This function decorator is used to specify a class method in a class definition.
  • compile() This function is used to compile a source code string or a file into a code object that can be executed by the Python interpreter.
  • complex()This function returns a complex number created using given real and imaginary parts.
  • delattr()This function deletes the specified attribute in the given object.
  • dict()This function is used to create a dictionary (set of key-value pairs).
  • dir()This function returns a list of all the properties and methods of the given Python object.
  • divmod()This function takes two numbers as arguments, and returns the quotient and remainder as a pair.
  • enumerate()This function takes an iterable (sequence) and returns an enumerate object.
  • eval()This function takes an expression (string), parses it into Python code, and evaluates it.
  • exec()This function takes Python code (as a string or a code object), parses it, and executes the code.
  • filter()This function can filter or remove items from an iterable object based on the specified condition. The syntax and examples for the filter() function are given in this tutorial.
  • float()This function can take a string or a number, and convert it into floating point number.
  • format() This function is used to format a given value into a specified representation.
  • frozenset() This function is used to create a frozenset.
  • getattr() This function reads the value of an attribute of an object.
  • globals() This function returns all the global variables with values as a dictionary, implementing the current module namespace.
  • hasattr() This function is used to check if the object has specific attribute.
  • hash() This function returns the hash value of an object. The object must be hashable, otherwise, the function throws TypeError.
  • help() This function is used to provide interactive help and documentation for objects such as functions, modules, classes, and methods.
  • hex()This function returns the hexadecimal representation of the given integer.
  • id() This function returns the ID value of an object.
  • input()This function is used to read input entered by a user via a standard input device.
  • int()This function is used to create an integer from a string, or another number, with an optional base value.
  • isinstance() This function is used to check if given object is an instance of specified class.
  • issubclass() This function is used to check if given class is an instance of another specified class.
  • iter() This function is used to get an iterator object for an iterable.
  • len()This function returns the length of an object. The syntax and examples are given in this tutorial.
  • list()This function is used to create a list from given iterable.
  • locals() This function is used to get the dictionary of local symbol table.
  • map()This function takes an iterator and a function, and returns a map with the elements from the iterator and the result of the function applied to each element. The syntax and examples are given in this tutorial.
  • max()This function takes two or more elements, or an iterable as argument(s), and returns the element with maximum value. Syntax, and examples are given in this tutorial.
  • memoryview() This function is used to get the memoryview of the given bytes-like object.
  • min()This function takes two or more elements, or an iterable as argument(s), and returns the element with minimum value. Syntax, and examples are given in this tutorial.
  • next() This function returns the next element in an iterator object.
  • object() This function is used to create an empty object.
  • oct()This function is used to convert an integer to an octal string prefixed with 0o.
  • open() This function is used to open a file specified by a path in specific mode.
  • ord()This function returns the Unicode point of the given character.
  • pow()This function takes base and exponent as arguments, and returns the power: base raised to the exponent. Syntax, and examples are given in this tutorial.
  • property() This function is used to create a property with specific setter function, getter function, and delete function for the property.
  • range()This function is used to generate a range or sequence of numbers with the defined start, end, and difference between the elements. Syntax, and examples are given in this tutorial.
  • repr() This function is used to get the string representation of a given object.
  • reversed()This function reverses the order of elements in the given sequence.
  • round()This function returns the given number rounded to the specified number of decimal points.
  • set()This function is used to create a Set from the items of the given iterable.
  • setattr() This function sets a value for an attribute of an object.
  • slice() This function is used to find the slice of a given iterable like list, tuple, string, etc.
  • sorted()This function takes a collection or iterator as argument, and return a list with the items sorted. Syntax, and examples are given in this tutorial.
  • @staticmethod This function decorator is used to transform a method in a class into a static method.
  • str()This function creates a String from the given argument. Syntax, and examples are given in this tutorial.
  • sum()This function returns the sum of the items in the given iterable.
  • super() This function is used to call the method in parent/super class, without specifying the name of the parent class.
  • tuple()This function creates a tuple with the items from the given iterable.
  • type()This function takes an object as argument, and returns the type of the given object. Syntax, and examples are given in this tutorial.
  • vars() This function is used to get the attributes of a given object as a dictionary.
  • zip()This function is used to iterate over multiple iterators parallelly. The iterator produces tuples with items from the individual iterators.

Related Tutorials

Code copied to clipboard successfully 👍