daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. balance = 999999
  2. annualInterestRate = 0.18
  3. balance2=balance
  4. low= balance / 12
  5. high=balance*((1 + annualInterestRate/12)**12 /12)
  6. ans=round((low+high)/2, 2)
  7. balance2=balance
  8.  
  9. while balance2 > 0:
  10.     for month in range(1, 13):
  11.         balance2=(balance2- ans)*(1 + annualInterestRate/12)
  12.      
  13.     if balance2 < 0.01:
  14.             break
  15.     if balance2 > 0:
  16.             low=ans
  17.  
  18.     elif balance2 < 0:
  19.             high=ans
  20.  
  21.     ans=(low+high)/2
  22.     balance2=balance
  23.  
  24.    
  25. else:
  26.     ans=round(ans, 2)
  27.     print('Lowest Payment: ' + str(ans))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top