# 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)

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:
{"ft_lang_label":"__label__en","ft_lang_prob":0.84581816,"math_prob":0.92934656,"size":1252,"snap":"2020-24-2020-29","text_gpt3_token_len":334,"char_repetition_ratio":0.13862179,"word_repetition_ratio":0.0,"special_character_ratio":0.2859425,"punctuation_ratio":0.16289593,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9629461,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-05-30T12:53:51Z\",\"WARC-Record-ID\":\"<urn:uuid:13efd96d-c479-4cec-9327-9f2a0253f5cb>\",\"Content-Length\":\"10685\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4dd74c43-c63b-4105-8eba-7fef71ca791c>\",\"WARC-Concurrent-To\":\"<urn:uuid:b5baae67-dbe2-46c2-8705-a07bc9c1f350>\",\"WARC-IP-Address\":\"99.84.191.78\",\"WARC-Target-URI\":\"https://plutonicrainbows.com/2018/02/11/loan-calculator/\",\"WARC-Payload-Digest\":\"sha1:N6DVDURYICYMUJGMQOYKKDTAT3TH63BB\",\"WARC-Block-Digest\":\"sha1:6UP2D37KY7AMSXSRSHOCJQVQYYCO4EHW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347409171.27_warc_CC-MAIN-20200530102741-20200530132741-00481.warc.gz\"}"}