開始使用免費開始

使用 docstring

你已經開發了 MortgageCalculator 類別。現在,請完成一段 docstring,說明此類別的屬性。

本練習屬於課程

案例研究:用 Python 建構軟體

檢視課程

練習說明

  • 對於 months 屬性,加入「the number of months in the loan」。
  • 對於 monthly_payment 屬性,加入「the amount of the payment per month」。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

class MortgageCalculator(FinancialCalculator):

  """
  A class used to represent a mortgage calculator.

  Attributes
  -------
  months: ____.
  monthly_payment: ____.
  """
  # Code omitted for space
編輯並執行程式碼