All the Built-in Functions of Python

Updated 14 August 2020

In the attempt to give the most comprehensive and truly easy to understand reference pages for the programming language of Python it is only natural to talk about built-in functions. A function in Python is a block of code which only runs when it is called. It is organised, reusable and performs a single related action. Functions are all about making it easier for the user whilst increasing modularity and improving code reusability. Python gives you many built-in functions. Built-in functions do not need to be imported and can be utilised instantly as they are installed into Python by default. We have explored print and its complexities together in previous guides, along with a few other built-in functions, but here are all of them.

This guide will provide an understanding of every built-in function within Python. Furthermore, it will summarise their purposes and demonstrate to you how to put them into code. Contents of this guide can be seen below.

There are several related tutorials on our website to help you become a true Pythonista. A great place to start would be Python Rundown and Main Windows. This will also tell you where to download Python and access online Python emulators. Python is an excellent language to utilise with Raspberry Pi Boards such as Raspberry Pi 4 Model B 8GB. These are very rad computing devices that can easily fit in the palm of your hand.

As always if you have any questions, queries, or things to add please let us know your thoughts!


Overview

Fashionable snake ready for the function (may not be a python don't tell anyone)

The goal of this reference point is to prevent you from being sideswiped by some function that you have never heard of. Or if there is a function you have not seen you will be able to realise its not part of the default Python selection of functions. It is worth noting that it is possible to create your own personal functions. These are referred to as user-defined functions. If you are going through someone else code, particularly one that has not been commented well, you can run into user-defined functions without even realising it. Having a grasp of all the default tools available to you will keep morale and motivation high on your coding travels.

Within these tables, it will talk about iterable objects. Iterable is any Python variable capable of returning its data members one at a time (ergo has a countable number of values). This permits it to be iterated over in a loop. Familiar examples of this include lists, tuples and strings. Mutable and immutable will also come up in these tables. Mutable variables are capable of being altered after they have been created whereas immutable variables cannot be changed or altered. Boolean functions also comes up which results in either True or False results.

In code, a sentinel value makes it possible to detect the end of the data when no other means to do so (such as an explicit size indication) is provided. The presence of a sentinel value guarantees termination of a loop that processes structured data. Also, worth knowing when you see | / | in the syntax of code column it represents a place for keyword arguments. Arguments are the values passed in when the function is called. They give more depth to the function and more control to what will happen to the data. Python identifiers are user-defined names to represent a variable.


Built-in Conversion Functions

Below is a selection of Python built-in functions all focused on converting one data type into another. A description for each and the syntax when utilising them in Python code are also given.

Built-in Conversion Functions


Built-in Type Functions

Below is a selection of Python built-in functions all focused on determining variable types. They can be used either to establish the type of the variable or alter it. A description for each and a code example when utilising them inside Python to make variables are also given.

Built-in Type Functions


All Other Built-in Functions

And here is the doozy! This is a list of all the other functions built-in for default Python. The first six are commonly utilised functions. After the first six, the rest of the functions are given in alphabetical order. If the function is a boolean or math type function it is explicitly mentioned with special tags to make them easier to find. The description of the Python function and the syntax of written code is also given.

Every inbuilt function in Python


The Next Step

After this large reference piece is time to start diving back into making functional codes. Loops and other flow control keywords are coming up real soon and they affect the execution flow of code in ways we haven't encountered before. To learn the best way to conceptualising this flow the guide Control Structures in Python should be the next point of call.

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.