CoCalc Public Files2021-03-11-081708.ipynbOpen with one click!
Authors: Marielys Bueno, Dylan Cortes
Views : 53
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
def savings_forloop(p,r,n,c,t): for i in range(t): a = p*(1+r/n) + c return a
In [2]:
savings_forloop(1000,.033,12,0,120) #1-Monthly
1390.3382740533493
In [3]:
savings_forloop(1000,.033,52,0,520) #2-Weekly
1390.8225472619663
In [5]:
savings_forloop(1000,.033,24,0,240) #3-Hourly
1390.6528772794236
In [6]:
savings_forloop(1000,.033,3600,0,36000) #4-By the Second
1390.9660246363771
In [ ]: