Hi everybody,
Here is the different steps to create a basic function and called it:
- To create an function you have to use « def NameOfTheFunction (arguments) : »
- After you have to put your instructions inside the function (code indented)
- To call your function you have to write this instruction: NameOfTheFunction (argument chosen)
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 !
Masteries 11 and 12 by aureliemartinette is licensed under a Creative Commons Attribution 4.0 International License.