Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calc():
- choice = raw_input("What type of interest is it you want to calculate?\n1. Simple Interest - 1\n2. Compound Interest - 2\nPlease Choose 1 or 2: ")
- if choice == "1":
- p = raw_input("Enter the Amount Borrowed: ")
- r = raw_input("Enter the Interest Rate: ")
- t = raw_input("Enter the Amount of Time: ")
- i = int(p) * float(r) * int(t)
- ans = float(i) + float(p)
- print "You Will Owe %r Dollars Back to Your Lender" % ans
- if choice == "2":
- p = raw_input("Enter the Principal Amount: ")
- i = raw_input("Enter the Interest Percentage: ")
- t = raw_input("How Many Intervals Until Loan Ends?: ")
- ans = float(p) * (1 + float(i)) ** float(t)
- print "You'll Owe Back %r in Interest." % ans
- calc()
- else:
- calc()
- calc()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement