Calculating compound interest. : For : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » For »

 

Calculating compound interest.


principal = 1000.0   # starting principal
rate = .05           # interest rate

print "Year %21s" "Amount on deposit"

for year in range111 ):
   amount = principal * 1.0 + rate ** year
   print "%4d%21.2f" year, amount )



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» For