Mastery12. Creating Python Functions

For this mastery im going to explain how to create a function in Python, which is very simple.

You can see in the screen capture above the syntax, which is composed by the word “def” followed by the name you are giving the function and the argument of this one, also, dont forget to put the tho dots at the end. In the following lines you have to define what your function is going to do, and this can vary depending of the functionality of this.

The statement return is the output of the function, is what the function is going to return the user with a giving parameter.

 Also you can check for more information here: http://www.tutorialspoint.com/python/python_functions.htm

CC BY 4.0 Mastery12. Creating Python Functions by Manuel Madrigal is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.