• Articles
  • Tutorials
  • Interview Questions

Python Built-in Functions - A Complete Guide with Examples

Tutorial Playlist

Built in Functions in Python

Back in the Python Functions module, we learnt that there are three types of functions, namely, user-defined functions in Python, lambda functions in Python, and built in functions in Python. In this module, we will learn all that we need to know about built in functions in Python.

So, without further ado, let’s get started.

Python interpreter has various pre-defined functions that are readily available to use. We don’t have to define these functions to use them; we can directly call them. These functions are called built in functions.
In the previous modules of this Python tutorial, we have used various built in functions. The very basic built in function that we have used in almost every module is the print() function which is used to display a given object.

Learn end-to-end Python concepts through the Python Course in Hyderabad to take your career to a whole new level!

Become a Python Expert

Get 100% Hike!

Master Most in Demand Skills Now !

Table of Built in Functions in Python

The print() function is just one of many built in functions in Python. Let’s learn about more built in functions and their descriptions through the following table.

Python Built in Functions Description
Python abs() It returns the absolute value of a number, and the returned value is always positive.
Python all() It returns true when all elements in an iterable are evaluated to be true orif there are no elements in an iterable. It returns false if any element is evaluated to be false.
Python any() It checks if any element of an iterable is true. Unlike all(), it returns false if there are no elements in the iterable.
Python ascii() This method returns a string containing printable representation.
Python bin() This built in function in Python is used for converting an integer to a binary string.
Python bool() This built in function in Python is used for converting a value to Boolean.
Python bytearray() This built in function in python returns an array of the given byte size.
Python bytes() This built in function in Python returns immutable bytes object.
Python callable() This built in function Python is used for checking if the object is callable.
Python chr() This built in python function returns a character (a string) from an integer.
Python classmethod() This built in python function returns the class method for a given function.
Python compile() This built in python function returns a Python code object.
Python complex() This built in function in Python is used for creating a complex number.
Python delattr() This built in function in Python is used for deleting an attribute from an object.
Python dict() This built in function is used for creating a Python dictionary.
Python dir() This built in python function tries to return the attributes of an object.
Python divmod() This built in python function returns a tuple of quotient and remainder.
Python enumerate() This built in python function returns an enumerate object.
Python eval() This built in python function runs the Python code within a program
Python exec() This built in python function is used for executing a dynamically created program.
Python filter() This built in function in Python is used for constructing an iterator from the elements which are true.
Python float() This built in function in Python is used for returning the floating-point number from a number or a string.
Python format() This built in python function returns the formatted representation of a value.
Python frozenset() This built in python function returns an immutable frozenset object.
Python getattr() This built in python function returns the value of the named attribute of an object.
Python globals() This built in python function returns the dictionary of a current global symbol table.
Python hasattr() This built in python function returns a value that tells whether an object has a named attribute.
Python hash() This built in python function returns the hash value of an object.
Python help() This built in python function Invokes the built in help system
Python hex() This built in function in Python is used for converting an integer to its hexadecimal form.
Python id() This built in python function returns the identify of an object.
Python input() This built in python function usually reads and returns a line of string.
Python int() This built in python function returns an integer from a number or a string.
Python isinstance() This function checks if an object is an instance of a class.
Python issubclass() This checks if an object is a subclass of a class.
Python iter() This function returns an iterator for an object.
Python len() This function returns the length of an object.
Python list() This function is used for creating a Python list.
Python locals() This function returns the dictionary of a current local symbol table
Python map() This function applies functions and returns a list.
Python max() This function returns the largest element.
Python memoryview() This function returns the memory view of an argument.
Python min() This function returns the smallest element.
Python next() This function retrieves the next element from an iterator.
Python object() This function creates a featureless object.
Python oct() This function converts an integer to its octal form.
Python open() This function returns a file object.
Python ord() This function returns a Unicode point for a Unicode character.
Python pow() This function evaluates and returns x to the power of y.
Python print() It is used for printing a given object.
Python property() This function returns a property attribute.
Python range() This function returns the sequence of integers between start and stop.
Python repr() This function returns the printable representation of an object.
Python reversed() This function returns the reversed iterator of a sequence.
Python round() This function rounds a floating-point number to n digits places.
Python set() This function returns a Python set.
Python setattr() This function sets the value of an attribute of an object.
Python slice() It is used for creating a slice object specified by the range() function.
Python sorted() This function returns the sorted list from a given iterable.
Python staticmethod() This function creates a static method from a function.
Python str() This function returns an informal representation of an object.
Python sum() This function is used for adding items of an Iterable.
Python super() This function allows us to refer to the parent class by ‘super’.
Python tuple() Function This function creates a tuple in python.
Python type() This function returns the type of object.
Python vars() This function returns the __dict__ attribute of a class.
Python zip() This function returns an iterator of tuples.
Python __import__() This function is an advanced function called by ‘import’.

Are you interested in learning Python from experts? Enroll in our Python Course in Bangalore now!

Learn new Technologies

These are the built in functions in Python. They all perform their respective operations when executed. To use these Python built in functions, all we have to do is to call them and pass the relevant argument as mentioned in the description of each built in function.

With this, we come to the end of this module in Python Tutorial. Now, if you want to know, why Python is the most preferred language for data science, you can go through this blog on Python Data Science tutorial.

Further, check out our offers for Python training Courses and also refer to the trending Python interview questions and answers prepared by the industry experts.

Course Schedule

Name Date Details
Python Course 04 May 2024(Sat-Sun) Weekend Batch
View Details
Python Course 11 May 2024(Sat-Sun) Weekend Batch
View Details
Python Course 18 May 2024(Sat-Sun) Weekend Batch
View Details

Full-Stack-ad.jpg