Calling & Creating Functions

--Originally published at Py(t)hon

I think is time to start with functions, i’m no experts at this topic so maybe we can learn together, let’s go

First, what is a function? Very simple, is a piece of reusable code that can be call upon whenever you need it. In other words, if you are going to repeat a code several time the best you can do is create a function, so you don’t have to write it all over again and again. Is to make your life easier.

To create a function you have to start with def follow by parenthesis (), inside this parenthesis goes the parameters necessary, if needed of course, after the parenthesis goes a colon (:) and then to close it, use the return function follow by the value statement, if you don’t want it to return anything, just leave a blank space, the system will take it like None.

Here is my example:

def1.png

In this example I can call whenever I want the areacuadro function, that will be all:) #Pug#Tec#TC101#Functions

Here is a webpage where you can find it better explain link