title: How to simplify my Python program?
body: <p>I'm trying this Compound Interest problem I found on the internet:</p>
  
  <p>A=P(1+r) n, where P is the amount invested, r is the annual percentage rate (as a decimal 5.0%=0.050) and n is the number of years of the investment.</p>
  
  <p>3 lists representing investments, rates, and terms</p>
  
  <pre><code>investment = [10000.00, 10000.00, 10000.00, 10000.00, 1.00]
  rate = [5.0, 5.0, 10.0, 10.0, 50.00] 
  term = [20, 40, 20, 40, 40]
  </code></pre>
  
  <p>I made my program like this but I feel instead of writing everything out like I did, I could use something called a loop, but I'm not sure how I can use a for loop properly cuz everytime I do, I mess it up:</p>
  
  <pre><code>rateindecimal = [int(rate[0])/100.0, int(rate[1])/100.0, int(rate[2])/100.0), int(rate[3])/100.0, int(rate[4])/100.0]
  </code></pre>
  
  <p>I converted the percent rate into a decimal, but how can I use a loop instead to run through the rate list and convert it easily?</p>
  
  <p>Then I did this. I feel it's too repetitive and once again, I feel that I need a loop but I'm not very good in using one...</p>
  
  <pre><code>A1 = int(Investment[0]) * (1 + ratedecimal[0])**int(term[0])
  A2 = int(Investment[1]) * (1 + ratedecimal[1])**int*term[1])
  </code></pre>
  
  <p>etc...</p>
  
  <pre><code>print "$" + str(round(A1, 2))
  print "$" + str(round(A2, 2))
  </code></pre>
  
  <p>etc with that as well.</p>
  
  <p>I'm sorry if this is really lengthy. I just want to know how to loop through it all so I don't have to be so repetitive.</p>
  
  <p>Thanks!</p>