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