始める無料で始める

ドックストリングを使う

MortgageCalculator クラスを作成しました。次に、このクラスの属性について説明を加えるドックストリングを完成させましょう。

この演習はコースの一部です

ケーススタディ: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
コードを編集して実行