Based on what we have learned in this chapter, we are ready to put together about two dozen functions related to finance 101 or other finance courses, and call our final big program fin101.py
. After debugging all the errors, we could call this module (program) easily by issuing the command from fin101 import *
. A more detailed procedure of how to generate such an R-based financial calculator is as follows:
Create an empty Python file called
fin101.py
and save it under our default directory, that is,Python33
inC:
, or other designated directory.Add the
pv_f()
function tofin101.py
, and debug the program until it is error free.Repeat the previous step by adding one function at a time until
fin101.py
includes all our functions.Generate a function called
fin101
, which is used to offer a list of all our included functions. A few lines are shown in the following code. Assuming that ourfin101.py
file has only two functions, we could generate a very simple...