Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #beggining
- def start():
- start1 = True
- start2 = input("Hello, and welcome to your Mortgage Calculator. Please Enter \"Start\" to start")
- if start2.upper() == "START":
- print("Starting...")
- else:
- print("You have not written \"Start\"")
- start1 = False
- if start2.upper() == "START":
- print("Hello, in order to begin, we need to know the cost of each payment, wether the payment is monthly, weekly, or daily, and we need to know the interest rate")
- #questions
- Amount = float(input("How much of a loan have you taken?"))
- interest_rate = float(input("What is the interest rate on the loan? Please input the interest as a decimal. \n For example, a 3 percent interest rate would be written like 0.03"))
- payment_method = input("Is the payment monthly, yearly, or weekly?")
- if payment_method.lower() == "monthly":
- month = int(input("How many months do you have to play the loan off in?"))
- if payment_method.lower() == "yearly":
- year = int(input("How many Years do you have to play the loan off in?"))
- if payment_method.lower()== "weekly":
- week = int(input("How many months do you have to play the loan off in?"))
- else:
- print("Please check to make sure that you have written \"Monthly\", \"Yearly\", or \"Weekly\" correctly.")
- interest_total = (Amount * interest_rate) + Amount
- if payment_method.lower() == "monthly":
- a = interest_total / month
- print("You are going to have to pay {} per month".format(a))
- if payment_method.lower() == "yearly":
- b = interest_total / year
- print("You are going to have to pay {} per year".format(b))
- if payment_method.lower()== "weekly":
- c = interest_total / week
- print("You are going to have to pay {} per week".format(c))
- def start2():
- Amount = float(input("How much of a loan have you taken?"))
- interest_rate = float(input("What is the interest rate on the loan? Please input the interest as a decimal. \n For example, a 3 percent interest rate would be written like 0.03"))
- payment_method = input("Is the payment monthly, yearly, or weekly?")
- if payment_method.lower() == "monthly":
- month = int(input("How many months do you have to play the loan off in?"))
- if payment_method.lower() == "yearly":
- year = int(input("How many Years do you have to play the loan off in?"))
- if payment_method.lower()== "weekly":
- week = int(input("How many months do you have to play the loan off in?"))
- else:
- print("Please check to make sure that you have written \"Monthly\", \"Yearly\", or \"Weekly\" correctly.")
- interest_total = (Amount * interest_rate) + Amount
- if payment_method.lower() == "monthly":
- a = interest_total / month
- print("You are going to have to pay {} per month".format(a))
- if payment_method.lower() == "yearly":
- b = interest_total / year
- print("You are going to have to pay {} per year".format(b))
- if payment_method.lower()== "weekly":
- c = interest_total / week
- print("You are going to have to pay {} per week".format(c))
- def restart():
- restart = input("If you would like to restart, please type \"Start\"")
- if restart.upper() == "START":
- start2()
- start()
- restart()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement