In certain situations, a need is raised in such a way that a particular part of the program needs to be repeated several times in various parts of the same program. In such situations, the repeated part of the program is defined as a function and the function is called whenever necessary instead of typing that bit of the program again and again. The syntax for defining a function is given as follows.
body of the function
functionname(paramenters); # calling the function separately
Now consider the following example to understand better,
def check(): # this part of the program is not executed untill the function is called in the later part of the program.
print('welcome') # a function names 'check' is created which can print the 2 print statements inside it, if and only if it is called elsewhere in the program.
print('to FACE Prep')
print('call the function again to observe the output')
to FACE Prep call the function again to observe the output welcome
to FACE Prep