BaşlayınÜcretsiz Başlayın

Calculating the number of periods

One real-life example that uses these functions is calculating how long it will take you to reach a certain financial goal, be it growing your wealth, saving for something specific, or paying off debt.

How long will it take you to save USD 30,000 if you save USD 1,250 per quarter invested in a fund that offers 4.5% annual returns compounded quarterly?

Bu egzersiz

Bond Valuation and Analysis in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the numpy_financial package using the alias npf.
  • Use the npf.nper() function to calculate how long it will take you to reach your savings goal based on the information above and save this to number_periods.
  • Print the result.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import numpy_financial package using alias npf
____

# Calculate how long it will take to reach the savings goal
number_periods = ____

# Print the result
____
Kodu Düzenle ve Çalıştır