Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
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 ans3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started