Created
January 18, 2012 01:08
-
-
Save sbentzen/1630140 to your computer and use it in GitHub Desktop.
A Challenge!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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