# # interest.py # worked in class on Sep 13 # # $100, at 5% per year, for 10 years, # compounded monthly principle = 100 # in dollars interest = 0.05 # per year interest_per_month = interest / 12 years = 10 for month in range(12 * years): principle = principle + (principle * interest_per_month) # principle = principle * (1 + interest_per_month) print "The answer is", principle