MulaiMulai sekarang secara gratis

Compound interest

As you saw in the previous exercise, both time and the rate of return are very important variables when forecasting the future value of an investment.

Another important variable is the number of compounding periods, which can greatly affect compounded returns over time.

Latihan ini adalah bagian dari kursus

Introduction to Financial Concepts in Python

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# 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)))
Edit dan Jalankan Kode