title: Python For Loops with interest payments
body: <p>I 'm trying to run this program by having it accept 3 parameters for my functions and using it to calculate compounded interest over the time period. After which calculating and displaying the total at the end of the time period.</p>
  
  <p>This is my code: </p>
  
  <pre><code>principal=float(input("Enter an initial principal value: "))
  interest=float(input("Enter an interest rate: "))
  years=int(input("enter how many years it will take: "))
  
  def payment(principal, interest, years):
      n=principle*((1+interest)**years)
  
      for n in range(principal,total):
          print(n)
          total=n+total
  
  payment(principal, interest, years)
  </code></pre>
  
  <p>The issues I have with this model is that it gives me an error of :  </p>
  
  <pre><code>    for n in range(principal,total):
  TypeError: 'float' object cannot be interpreted as an integer
  </code></pre>
  
  <p>and furthermore I'm not too sure if it will compound the interest for each period and add that to the principal when it calculates next years compounded interest.</p>