Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

By: Yuxing Yan

Overview of this book

Table of Contents (20 chapters)
Python for Finance
About the Author
About the Reviewers

Two ways to call our pv_f() function

To call our pv_f() function included in the Python program, we can use import test01 or from test01 import *. Obviously, it is more convenient to use pv_f() instead of test01.pv_f(). To call the function directly, we use from test01 import *. Refer to the following parallel structures:

>>>from math import *
>>>from test01 import * 

When we are sure about the existence of a specific function in, we can import it specifically as follows:

>>>from math import ceil,sqrt,pi
>>>from test01 import pv_f

The del() built-in function is used to remove a function or variable, as shown in the following code:

>>>del pv_f
['__builtins__', '__doc__', '__loader__', '__name__',