Functions in Python are declared using the reserved word 'def'. If the function takes any arguments, these are enclosed in parentheses after the function name. As with other languages, the names given to the functions arguments are those used in the function code. In the rest of the program, they may be known by other names. What matters is not the precise variable name but the data type of the variable passed.
The code below illustrates how a function is defined and later called by the main program. Unlike C, Python requires that all functions be prototyped (i.e., be declared before being called in the main program).
def multiply(a,b):
c = a*b
return c
product = multiply (x,y)
