使用文档字符串
您已经开发了 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