Exercise

Future value

The numpy module also contains a similar function, .fv(rate, nper, pmt, pv), which allows you to calculate the future value of an investment as before with a few simple parameters:

  • rate: The rate of return of the investment
  • nper: The lifespan of the investment
  • pmt: The (fixed) payment at the beginning or end of each period (which is 0 in our example)
  • pv: The present value of the investment

It is important to note that in this function call, you must pass a negative value into the pv parameter if it represents a negative cash flow (cash going out). In other words, if you were to compute the future value of an investment, requiring an up-front cash payment, you would need to pass a negative value to the pv parameter in the .fv() function.

Instructions

100 XP
  • Using NumPy's .fv() function, calculate the future value of a $10,000 investment returning 5% per year for 15 years and assign it to investment_1.
  • Calculate the future value of a $10,000 investment returning 8% per year for 15 years and assign it to investment_2.