Table of Contents
Python Built-in Functions and Methods List with Examples
I will tell you about mostly used built-in methods in Python 3 along with the real-world examples. Now the question arises why do we need to check out this list, let me tell you why we need to have a look thoroughly in this useful Python 3 built-in functions list because these built-in functions will help us to solve common programming problems daily.
“Ready to take your python skills to the next level? Sign up for a free demo today!”
Built-in functions in Python
1: Which of the following data types is immutable in Python?
Python 3 offers nearly around 68 built-in functions and methods to make python developers life easy. You can see below mostly used Python built-in methods with examples.
Without further ado, Let’s begin checking out this useful Python 2 | 3 built-in methods cheat sheet.
“Experience the power of our web development course with a free demo – enroll now!”
Python Built-in Functions explained
Here is the Python built-in functions list.
abs( )
The abs() function in Python get the positive (absolute) value of a numerical value.
The all() function in python checks if all the items of an iterable are true, else it returns False. The all() method also returns true if the iterable object is empty.
The any() function returns True if any item in an iterable is true, else it returns False. This method returns False if iterable is empty.
The ascii() function returns a readable representation of an object (Strings, Tuples, Lists, etc.) It replaces non-ascii characters with escape characters.
The bin() function converts an integer (number) to a binary string. It prefixed with 0b.
The bool() function is very helpful in converting an object to a Boolean value. This function returns True, except the object is false, empty, 0 or none.
The bytearray() function is used converts an object into bytearray objects.
The bytes() function is used to convert objects into bytes object.
The callable() function gets True, and if the passed object is callable, else it returns false.
The chr() function gets the string character, which represents the defined unicode.
The compile() function compiles the sources into a code.
The complex() function forms a complex number | convert string | number to complex number.
The delattr() function help us to remove the defined attribute from the declared object.
The dict() function form a new dictionary.
The dir() function gets all the properties and methods of the declared object, and It doesn’t get the values. It even returns the built-in properties which are default for all object.
Gets a tuple including the quotient and remainder when argument1 is divided by argument2.
It gets an enumerate object for a sequence or iterator.
Allows a legal python program to run python code.
The exec() function executes dynamic python code.
The float() function transforms a numerical value to floating point.
The format() function transforms the defined value into a specified format.
The frozenset() function gets the unchangeable object.
This function gets the value of the defined attribute from the particular object.
This function gets the dictionary from the current global symbol table.
This function return True, if the defined object has the mentioned attribute, else it will return False.
This method converts the numerical value into a hexadecimal value. The returned value comes with the 0x prefix.
This method gets a unique id for the defined object, Python provides a unique id to all the objects.
A user can define the value using the input() function.
This function transforms the mentioned value into a numerical value.
Returns true, if the defined object is a subclass of the defined object, else it will return false.
This function gets an iterator object.
This method returns the total number of elements in an object if an object is a string type, then the method will return the number of characters from the string.
The function generates a list object which is ordered and changeable.