Skip to content

Instantly share code, notes, and snippets.

@sbentzen
Created January 18, 2012 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbentzen/1630140 to your computer and use it in GitHub Desktop.
Save sbentzen/1630140 to your computer and use it in GitHub Desktop.
A Challenge!
import math
def compound_interest(principle, rate, term, period):
return principle * pow((1 + (rate/period)),(term * period))
p = float(raw_input("What is the Principal Value: "))
r = float(raw_input("What is the Rate: "))
t = float(raw_input("What is the Term: "))
n = float(raw_input("What is the Number of Payments: "))
print "The Final amount is $" + "{0:.2f}".format(compound_interest(p,r,t,n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment