Question: Please have explanations beside every code. Question 3a: Compound Interest with Regular Deposits (2 points) If p is the bank's interest rate in decimal (e.g.,

Please have explanations beside every code.Please have explanations beside every code. Question 3a: Compound Interest with RegularDeposits (2 points) If p is the bank's interest rate in decimal

Question 3a: Compound Interest with Regular Deposits (2 points) If p is the bank's interest rate in decimal (e.g., 0.05 means 5%.) per year, an initial amount a will grow after n years to: a(1 + p)" Write a Python function growth(a, p, n) that returns the future value (that is, the total amount of funds), starting with amount a , rate p , for n years. You can assume that all parameters are non-negative. (Your solution does not need to check for that condition, it should simply assume it.) The input p represents the interest rate as a floating point number. In [ ]: def growth(a, p, n): # Your Code Here! return s In [ ]: growth (340000,0.0314,25) == 736473.447868039 In [ ]: growth (10,0.01,10) == 11.046221254112044 In [ ]: growth (65,100,3) == 66969565 Question 3b (1 point) What is the difference in savings if you invest $2000 for 20 years at 2% vs. 1% interest? Set ans3 to the difference in savings (as a positive number, rounded to two decimal places) in the cell below. NOTE: you should call the function you wrote in the previous section! In [ ]: def question3b(): # your work here! return ans3

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!