Functions: Calling and Creating them

--Originally published at angelmendozas

To call a function you use the word “def” followed by the name you want your function to have, after naming your function, you need parameters and these parameters go inside parentheses() and at the end of these you are required to put a “:” then you decide which function to return to get the function you desire and then define your parameters of the functions like this:

Captura de pantalla 2016-09-03 a las 8.55.53 p.m..png

And so like this the console should give you 4.

A simple explanation of calling a creating a function is using the commands told before and then naming however you want your function to be called and which one you want in return, and finally give values to your functions.

Obviously there are more complex ways to use functions, but for now I will just explain the basic.