def com_int(p,r,n,c,y): for i in range(n*y): p = p*(1+r/n)+c return p
com_int(1000,0.044,12,0,30)
This would mean that if someone deposited 1000intoanaccountthatiscompoundedmonthlywitha4.4 1000 into an account that is compounded monthly with a 4.4% interest for 30 years, it would be about 1000intoanaccountthatiscompoundedmonthlywitha4.4 3,734.40
com_int(1000,0.044,12,5,30)
This would mean that if someone puts 5amonthintothisaccount,theamountwouldroughlybe 5 a month into this account, the amount would roughly be 5amonthintothisaccount,theamountwouldroughlybe 7,463.12