Hi everybody,

Here is the different steps to create a basic function and called it:

  1. To create an function you have to use « def NameOfTheFunction (arguments) : »
  2. After you have to put your instructions inside the function (code indented)
  3. To call your function you have to write this instruction: NameOfTheFunction (argument chosen)Capture d’écran 2015-09-18 à 15.03.37

Comment:

It’s possible to created a function without argument, but it’s better to use it. This process is called generalization.

When you put code inside your function, you done an encapsulation.

Have a good day !

CC BY 4.0 Masteries 11 and 12 by aureliemartinette is licensed under a Creative Commons Attribution 4.0 International License.