複利
如同你在前一個練習所看到的,在預測投資的未來價值時,時間與報酬率都是非常重要的變數。
另一個關鍵變數是複利的計算次數(複利期間數)。它會隨著時間大幅影響累積報酬。
本練習屬於課程
Python 金融概念入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Predefined variables
initial_investment = 100
growth_periods = 30
growth_rate = 0.06
# Calculate the value for the investment compounded once per year
compound_periods_1 = ____
investment_1 = ____
print("Investment 1: " + str(round(investment_1, 2)))