Plutonic Rainbows

Loan Calculator

Using the Functions available for Maths, I built a simple loan calculator -including the elif and else statements so that Python can make a decision. I am sure there are much simpler ways of doing this but as I am still learning, it’s all I can do right now.

# -*- coding: utf-8 -*-

def amount_to_borrow(loan_request, twelve_months):
	print "Calculating 12 months interest totalling £{0:.2f}.\n".format (twelve_months)
	return loan_request + twelve_months

loan_request = (float(raw_input("How much do you want?\nEnter Amount: ")))

monthly_payments = loan_request / 12

twelve_months = monthly_payments + 15.00 * 12

interest_payments = 15 * 12

total = amount_to_borrow(loan_request, twelve_months)

raw_input("Press Return to get your decision.\n")

credit_limit = 5000

print "The cost of your loan is £{0:.2f}\n".format (total)
print "That's £{0:.2f} in 12 monthly payments".format (monthly_payments)
print "And £{0:.2f} in Interest Payments over 12 months.\n".format (interest_payments)
print "The limit for your account is £{0:.2f}\n".format (credit_limit)

if total < credit_limit:
	print "Your loan is approved.\n"

elif total > credit_limit:
	print "Sorry. You are not approved.\n"

	print "Please come into the branch to discuss it.\n"