Before you start
you must see our previous post My first C++ program
Before learning defining functions you must know what is the meaning of functions in programming languages.
What is the meaning of functions in programming ??
Function is a group of statement and it can run more than once in the program .Function is allow set of code to be grouped better as per functionality.One and More than one function is allow in the program .Ever function is defined its own functionality.It can reduce the complexity of program easy to finding the error in the program .Function is also reduce the work,Easy to update.
In languages other then python its return type or type of function(Ex-Int,float etc) is defined first .But in Python to define function is easy.
Below is the syntax of defining functions
def function( arg1,arg1,arg3=default…)
Function is most basic program of the structure .Function are also design tool for split the complexity into a parts.
for calling any function we can use
def fun(): #define the function
def fun(): #or it can define in else
fun() #call the function