Sie sind auf Seite 1von 1

Discuss the advantages of using functions within a program.

In your discussion address why


parameters and return values are important.

Advantages of functions

a) Coding time is greatly reduced in the case of routine one time and code statements and
this means results are obtained early.
b) Debugging time is reduced through the use of procedures and functions which may be
applicable in cases whereby the same code is used in many places making debugging
difficult
c) Code length can be shortened by using functions at appropriate places.

Parameters are important in that they catch the values sent to the function from a function call
through its arguments. Using parameters and return values allows functions to communicate with
the rest of the program.

One of the disadvantages of functions is that they may affect the whole program flow if placed
inappropriately in the code. An error occurs which restricts program from executing and that
requires the programmer to have the necessary knowledge to debug.

Sources

Dawson, M. (2010). Python programming. USA. Course technology

Das könnte Ihnen auch gefallen