Exercise

Comparing the duration of two bonds directly

A quick way to check the impact of a factor on duration is to find the duration of two different bonds where you increase this factor and see what effect it has on the bond's duration.

In this exercise, you will calculate the duration of a 10 year and a 20 year bond, both paying an annual coupon of 3%, with a face value of USD 100, and yield to maturity of 5%.

numpy_financial is already imported for you as npf.

Instructions 1/2

undefined XP
  • 1
    • Find the duration of the 10 year bond and print the result.
  • 2
    • Find the duration of the 20 year bond and print the result.