mortgage = [380000,385000,390000,395000,400000,405000,410000,415000,420000,425000] renovation = [60000,70000,80000,90000,100000,110000,120000,130000,140000,150000] rates = [0.0485,0.051,0.0535,0.056,0.0585,0.061,0.0635,0.066,0.0685,0.071,0.0735,0.076] combination = [] for x in mortgage: for i in renovation: combination.append( x + i) rates = [ (x -.0185)/12 for x in rates] monthly_payments = [] for x in combination: for i in rates: monthly_payments.append(((x-20000)*(i*(1+i)**360)/(((1+i)**360)-1)) + (.0185/12)*(x-20000) +1000 ) print "Min payment:", min(monthly_payments) print "Max payment:", max(monthly_payments) average_monthly = (min(monthly_payments) + max(monthly_payments)) / 2 print "Avg payment:", average_monthly #Monthly Payment includes PMI, Property Tax, Maintenance/Landscaping, Property Managment #I estimated based on rents in the area and rentals of comparble size that my worst case rental #income would be $4000 and my best would be $6000
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question