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
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Exercises


1. How do we generate a Python program without saving it? Please generate a function that triples any input value.

2. How do we use comments effectively when we write a Python program?

3. What are the advantages and disadvantages of using a default input value or values?

4. In this chapter, while writing a present value function, we use pv_f(). Why not use pv(), the same as the following formula?

Here PV is the present value, FV is the future value, R is the periodic discount rate, and n is the number of periods.

5. How do we debug a complex Python program?

6. What is the efficient way to test a Python program?

7. Why is indentation critical in Python?

8. How to put two formulae together, such as the present value of one future cash flow and the present value of an annuity?

9. How many types of comments are available? How do we use them effectively?

10. Write a fin101.py program and put together as many formulae as possible, such as pv_f(), pv_perpetuity(), pv_perpetuity_due(), dpv_annuity...