Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions