Question: Please read the instructions. Provide a sample of the code with the passed test cases. Please do not use f - strings or advance programming,

Please read the instructions. Provide a sample of the code with the passed test cases. Please do not use f-strings or advance programming, no hard-coding. Please provide a sample of the code with the passed test cases.
Calculating Investments
In this short project, you will calculate how many years it takes for an account balance to reach an
investment goal.
Name the program investment. py. Make sure that gradescope gives you the points for passing the test
cases.
Description of the problem
Here's the problem to solve:
Imagine you have x amount of dollars in an investment account that earns 5% interest per year.
How long (in years) does it take for the account balance to be times Y the original investment?initial_amount =10000goal_of_investment =2
message = investment_years(initial_amount, goal_of_investment)
print(message)
The investment of $10,000 will be 2 times larger in 15 years. Development strategy
You will need to use a while loop to solve this problem. You need to calculate what the goal amount is,
and you will calculate how much each passing year accrues until you get to the goal.
You will also need to create a year variable to count how many years it takes to achieve the goal.
Remember to increment year with every iteration.
Calculate the interest (multiply balance by 0.05) and the balance (add interest to it) in each iteration as
well.
Test cases
def main():initial_amount =10000goal_of_investment =2
message = investment_years(initial_amount, goal_of_investment)
print(message)print(investment_years(50000,10))main()
Please read the instructions. Provide a sample of

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 Programming Questions!