Question: Please use while loop function of python to solve this question, Thank you Suppose we decide to invest some money in an account that continously

Suppose we decide to invest some money in an account that continously compounds interest. In other words, the amount that we initially invested is constantly earning interest and any interest that we earned also keeps acquiring interest. At first, let's compute our earnings in the short term. Suppose you save $100 each month into a savings account that has an annual interest rate of 5%. So, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) *(1 + 0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 +0.00417) = 302.507 and so on. Before you begin writing any code, try writing out the pseudocode for your function. Think about how you would calculate the compound interest if you did the math by hand and use this to help you in the implementation. Now, write a new function savingsByMonth() that will save each month's savings as a new element in the list, which gets returned from the function. So, in the example above, the list would have the initial amount stored as the first element, 100.417 as the second element, etc. def savingsByMonth(amount, interest rate, months): Given a monthly contribution amount (e.g., 100), the annual interest rate (e.g., 5), and the number of months (e.g., 6), returns a list with the savings amount for each month, including the initial amount as the first element, and the savings in the given month as the last element. return "stub" # TODO: replace return "stub" with a correct return stateme Now that you have the list, you can one to your tabertplotapy and use the matplotlib
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
