Advertisement
otorp2

comp interest

Dec 27th, 2019
1,124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. rate = .1
  2. deposit = float(input('how much money would you like to deposit?'))
  3. total = deposit*(1+rate)
  4. interest = deposit * rate
  5. #years = ['one','two','three']
  6. for i in range(80):
  7.     print("after", i,"years, you earned %.2f interest" % interest,
  8.           "for a total of %.2f" % total)
  9.     total = total * (1 + rate)
  10.     interest = total * rate
Advertisement
RAW Paste Data Copied
Advertisement