#!/usr/bin/env python
import sys
import os
"""
Author : flo
date : 2017.02.13
Purpose : example of finding out the amount of principle paid to mortgage lender per year.
:
Comments: Simulate the number of mortgage payments based on the loan amount
: one can alter the number of months in the outer loop to reflict the
: term for your mortgage, say change 13 to 25,2years; 13 to 37, 3 years, etc...
: Will write an interactive one sometime soon !
:
usage : python mortgage.txt
usage : python mortgage.txt > report.txt
"""
def count():
# 250,000 is the amount from bank on a loan as an example
tot, sum = 250000, 0
# 12 months of the year
for i in range (1,13):
# assuming 30 days per-month
for x in range(1, 31):
# .0450 is the assume interest amount
sum = tot * .0450 * (1.00/365.00)
tot = sum + tot
print "Month\t" + str(i) + " Day\t" + str(x) + "\t" + str(round(tot,2)) + "\t" + str(round(sum,2))
# 650 is the amount of principle per month
# forgot to factor in the amount leader has taken interests out initially/automatically
# assume 300 is the amount a bank or lender has calculated for you each 12 month on an escrow plan
# 650 is the principle amt in that escrow + additional principle you wish to add to your monthly
# balance towards your mortgage
tot = tot - ( 650 + 300 )
def main():
count()
# calling main
if __name__ == "__main__":
main()