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 method returns the absolute value of the given number. The tutorial contains syntax, and examples for abs() function.
  • all()This method returns True if all the items in the given iterable are True. The tutorial contains syntax, and examples for all() function.
  • any()This method returns True if any of  the items in the given iterable is True. The tutorial contains syntax, and examples for any() function.
  • ascii()This method 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 method returns binary value of given integer. The tutorial contains syntax, and examples for bin() function.
  • bool()This method returns a boolean value of the given object. The tutorial contains syntax, and examples for bool() function.
  • bytearray()This method 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 method 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 method returns True if given object is callable, or False otherwise. The tutorial contains syntax, and examples for callable() function.
  • chr()This method returns the character specified by the given Unicode code point. The tutorial contains syntax, and examples for chr() function.
  • classmethod()
  • compile()
  • complex()This method returns a complex number created using given real and imaginary parts.
  • delattr()This method deletes the specified attribute in the given object.
  • dict()This method is used to create a dictionary (set of key-value pairs).
  • dir()This method returns a list of all the properties and methods of the given Python object.
  • divmod()This method takes two numbers as arguments, and returns the quotient and remainder as a pair.
  • enumerate()This method takes an iterable (sequence) and returns an enumerate object.
  • eval()This method takes an expression (string), parses it into Python code, and evaluates it.
  • exec()This method takes Python code (as string or code object), parses it, and executes.
  • filter()This method can filter or remove items from given iterable object based on the specified condition. The syntax, and examples for filter() function are given in this tutorial.
  • float()This method can take a string or a number, and convert it into floating point number.
  • format()
  • frozenset()
  • getattr()
  • globals()
  • hasattr()
  • hash()
  • help()
  • hex()This method returns the hexadecimal representation of the given integer.
  • id() This method returns the id value of given object.
  • input()This function is used to read input entered by user via standard input device.
  • int()This method is used to create an integer from a string, or another number, with an optional base value.
  • isinstance()
  • issubclass()
  • iter() This function is used to get an iterator object for given iterable.
  • len()This method returns the length of given object. Syntax, and examples are given in this tutorial.
  • list()This method returns a list created from the items of the given iterable.
  • locals()
  • map()This method takes an iterator and a function, and returns a map with the elements from iterator and the result of the function applied to each element. Syntax, and examples are given in this tutorial.
  • max()This method 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()
  • min()This method 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()
  • object()
  • oct()This function is used to convert an integer to an octal string prefixed with 0o.
  • open()
  • ord()This method returns the Unicode point of the given character.
  • pow()This method takes base and exponent as arguments, and returns the power: base raised to the exponent. Syntax, and examples are given in this tutorial.
  • property()
  • range()This method 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()
  • reversed()This method reverses the order of elements in the given sequence.
  • round()This method returns the given number rounded to the specified number of decimal points.
  • set()This method is used to create a Set from the items of the given iterable.
  • setattr()
  • slice() This function is used to find the slice of a given iterable like list, tuple, string, etc.
  • sorted()This method takes a collection or iterator as argument, and return a list with the items sorted. Syntax, and examples are given in this tutorial.
  • str()This method creates a String from the given argument. Syntax, and examples are given in this tutorial.
  • sum()This method returns the sum of the items in the given iterable.
  • super()
  • tuple()This method creates a tuple with the items from the given iterable.
  • type()This method takes an object as argument, and returns the type of the given object. Syntax, and examples are given in this tutorial.
  • vars()
  • zip()This method is used to iterate over multiple iterators parallelly. The iterator produces tuples with items from the individual iterators.