Question: Write a function in python how _ long that takes as input the amount for an initial investment, a final target amount, and the expected

Write a function in python how_long that takes as input the amount for an initial investment, a final target amount, and the expected interest rate of the account (as a decimal), and it returns the number of years it will take to achieve the target amount.
For example, if you win a small lottery and decide to invest 50,000 dollars today in the market, which historically averages a 7% annual return, and you want to wait for it to become a million dollars, then how_long(50000,1000000,0.07) should return 44.27715216205352, telling you that it will take just over 44 years.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!