Aan de slagBegin gratis

Docstring gebruiken

Je hebt de klasse MortgageCalculator ontwikkeld. Vul nu een docstring aan om uitleg te geven over de attributen van de klasse.

Deze oefening maakt deel uit van de cursus

Casestudy: Software bouwen in Python

Bekijk cursus

Oefeninstructies

  • Voeg voor het attribuut months toe: the number of months in the loan.
  • Voeg voor het attribuut monthly_payment toe: the amount of the payment per month.

Interactieve oefening met praktijkervaring

Probeer deze oefening door deze voorbeeldcode aan te vullen.

class MortgageCalculator(FinancialCalculator):

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

  Attributes
  -------
  months: ____.
  monthly_payment: ____.
  """
  # Code omitted for space
Code bewerken en uitvoeren