There are 2 types of functions. User-defined functions, the functions that you make. Or Pre-defined functions, the functions that Python has already made for you. Let’s first look at a User-defined flowchart.

This flowchart shows how def works. We use def to define a User-defined function. Here we are defining hello(). Inside the def body, it is showing what the function will do. At the end, it is writing hello() so all the statements inside the def body will be executed.

Output: Hello

This is how the flowchart will look in code.

Now let’s look at some Pre-defined functions.

Python Pre-defined functions or Built-in functions are functions that Python has built-in into its code. These functions do not have to be defined because they already are by Python. Some examples are:






And many more.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store