Class work:
Calculate compound interest using the for loop.
Yesterday you learned how to use a for loop to calculate the amount of money that builds up after applying compound interest. Assuming that all the interest is left on deposit, calculate and print the amount of money in the account at the end of each year over a period of 10 years. Prompt the user for principal and rate in decimal format.
To determine these amounts, use the following formula:
amount = principal * ( 1 + rate )** year
where
pincipal is the original amount invested ( i.e. , the principal )
rate is the annual interest rate ( e.g., .05 stands for 5% )
year is the number of years
amount is the amount on deposit at the end of the nth year.
Write a python program YI_compoundInterestCalc.py to calculate the money that remains on deposit for n number of years.