Advertisement
Guest User

Untitled

a guest
Feb 26th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #5.27
  2.  
  3. def main():
  4.   loan = eval(input("Loan Amount: "))
  5.   years = eval(input("Number of Years: "))
  6.   print(format("Interest Rate","<25s"),format("Monthly Payment","<25s"), format("Total Payment","<25s"))
  7.   count = .05
  8.   while (count <= .08125):
  9.       monthlyPayment = (loan * (count/12) / (1 - 1 / (1 + (count/12)) ** (years * 12)))
  10.       totalPayment = monthlyPayment * years * 12
  11.       print(format(round(count * 100, 3),"<25f"), format(monthlyPayment,"<25f"), format(totalPayment,"<25f"))
  12.       count = count + (1 / 8) / 100
  13. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement