开始使用免费开始使用

复利(Compound interest)

正如您在上一个练习中看到的,时间和收益率在预测一项投资的未来价值时都非常重要。

另一个重要变量是复利计算的周期数。随着时间推移,复利频率会显著影响最终回报。

本练习是课程的一部分

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)))
编辑并运行代码