A few weeks ago we talked to you about the Predefined functions in Python, are those that they come integrated and they help us list, add, print on the screen, etc.
But sometimes we're going to need a function to do something specific outside of the predefined ones and we will have to create it ourselves, so let's see how it is done.
Remember that you can continue learning about programming, in EIP with our master in Advanced Programming in Python for Big Data, Hacking and Machine Learning.
Create a function in Python
To create a function we start from the instruction def, Let us remember that this word is included within the Keywords of Python, followed by the name of the function and ending it with a colon ' : '.

For example, we are going to make our first function print the typical "Hello World"

First we define in the function a print with Hello World and then we invoke it to print the message, remember that if the function is not called it will never do anything.
We can also make that function return a data to later assign it to some variable.

Finally, so as not to extend ourselves, we are going to see the functions with parameters, these functions receive parameters that we have previously defined to execute the corresponding code.

The parameters that our function receives can be any type of data, numbers, letters, lists, etc. But we will see that another time.
Next week we will use what we learned to update our Calculator in Python and make it a little more efficient.