Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

formula for compounding interest in python

P = int(input("Enter starting principle please. "))
n = int(input("Enter number of compounding periods per year. "))
r = float(input("Enter annual interest rate. e.g. 15 for 15% "))
y = int(input("Enter the amount of years. "))

FV = P * (((1 + ((r/100.0)/n)) ** (n*y)))

print ("The final amount after", y, "years is", FV)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #formula #compounding #interest #python
ADD COMMENT
Topic
Name
5+5 =