May-31-2024, 08:08 AM
(This post was last modified: May-31-2024, 09:16 AM by Pedroski55.)
Just for fun:
#annual_interest = 0.04 = 0.04 / 12 = 0.0033333333 ... per month portion_down_payment = 30000.00 # get how much you saved + interest of 0.0033 on savings each month def savings(cs, ms): accrued = cs * 1.0033 + ms yield accrued #annual_interest = 0.04 = 0.04 / 12 = 0.0033333333 ... per month portion_down_payment = 30000.00 monthly_savings = 1000 current_savings = 0 months = 0 while current_savings < portion_down_payment: months +=1 current_savings = next(savings(current_savings, 1000)) if months % 12 == 0: print(f'\nBeen saving for {months / 12} year(s) now, when can I move in???\n') print(f'months = {months}, current_savings = {round(current_savings, 2)}.') if (portion_down_payment - current_savings) < 1000: print(f'\nYou only need to pay {round(portion_down_payment - current_savings, 2)} this month and you are done!') print("Please borrow a lot of money from us, so we can charge you much more than 4% annual interest!") current_savings = portion_down_payment