# Compute effective interest rate
# Find total interest paid over a year if
# interest is compounded monthly, and
# express this as a percentage of the
# principle of the debt. 

principle = 5000.0
annualRate = 9.0

print 'principle is',principle
print 'annualRate is',annualRate

monthlyRate = annualRate/12.0

month = 0
balance = principle

while month < 12:
    month = month+1
    # Figure out interest to pay this month
    interest = balance*(monthlyRate/100.0)
    # Increase the balance by this month's interest
    balance = balance+interest

print 'Balance after one year is',balance

# Figure out total interest paid over the whole year
totalInterest = balance - principle
print 'Your total interest is',totalInterest

# What perecent interest did you pay?
eir =  (totalInterest/principle) * 100.0
print "Effective interest rate is",eir




    

