# benefit.py
import math
capital = 1000000 # 100萬
rateforLong = 1.9/100#定存利率0.95
rateforshort = 0.32/100#活存利率
def getmoney(month,rate):
return capital*(1+rate)**(month)
years = 8 #8年領完全部年金所需時間
month=years*12 #總月數
#resultforLong = capital*(1+rateforLong)**(month)
resultforLong = getmoney(month,rateforLong)
print ("定存的result:",resultforLong)
resultforshort = getmoney(month,rateforshort)
print ("活存的result:",resultforshort)
for mon in range(1,month):
for rate in [rateforshort]:
print("[mon]",str(mon),"[rate]:",str(rate),"=>\t",getmoney(mon,rate))
forOneMoney = 10000
for mon in range(1,month):
print ("[mon]"+str(mon),forOneMoney*mon)
沒有留言:
張貼留言