title: Interest Calculator In Python
body: <p><strong>Interest Calculator</strong> Let the user calculate the amount of money they will have in the bank after their interest has compounded for a certain number of years. </p>
  
  <p>Note: A = P(1+r)^t where A = total amount, P = principal, r = rate, and t = time.</p>
  
  <p>This is what I tried: </p>
  
  <pre><code>principal = input("How much money do you currently have in the bank?")
  rate = input("What is your interest rate?")
  time = input("Over how many years is the interest compounded?")
  actual_principal = float(principal)
  actual_rate = float(rate)
  actual_time = int(time)
  
  #TODO: Calculate the total amount and print the result
  A = (actual_principal(1 + actual_rate) ^ actual_time) 
  print(A)
  </code></pre>
  
  <p>I used actual_principal, actual_rate, and actual_time to convert the strings into (exact) integers...I used float instead of int because float will maintain an input with decimals, right?</p>
  
  <p>But I got an error message on line 9</p>
  
  <pre><code>TypeError: 'float' object is not callable on line 9
  </code></pre>
  
  <p>I'm assuming that the 'float' object refers to either actual_principal or actual_rate, or both, since those are the two values that I converted. Why, then, aren't they callable? How can I fix this program to calculate interest correctly? Thank you!  </p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>Learned that power function in python is ** and that implied multiplication operators don't exist in python syntax. Reworked my equation to look like this: </p>
  
  <pre><code>final_actual_rate = actual_rate + 1
  B = actual_principal * final_actual_rate
  A = B ** actual_time
  print(A)
  </code></pre>
  
  <p>When entering 13.58 for "How much money do you currently have in the bank?", 0.3 for "What is your interest rate?", and 5 for "Over how many years is the interest compounded?", I got the answer 1714808.43561 - so the calculator works! </p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Replaced my equation with this one - it's a better / cleaner way to create the interest calculator - although both will get you the same result: </p>
  
  <pre><code>A = math.pow(actual_principal*(1 + actual_rate) , actual_time) 
  print(A)
  </code></pre>