classes and object-oriented programming outstanding at the start of each monththe amount of money to be paid each month (initialized using the value returned by the function findpayment)and description of the mortgage (which initially has value of nonethe __init__ operation of each subclass of mortgage is expected to start by calling mortgage __init__and then to initialize self legend to an appropriate description of that subclass the method makepayment is used to record mortgage payments part of each payment covers the amount of interest due on the outstanding loan balanceand the remainder of the payment is used to reduce the loan balance that is why makepayment updates both self paid and self owed the method gettotalpaid uses the built-in python function sumwhich returns the sum of sequence of numbers if the sequence contains non-numberan exception is raised figure contains classes implementing two types of mortgage each of these classes overrides __init__ and inherits the other three methods from mortgage class fixed(mortgage)def __init__(selfloanrmonths)mortgage __init__(selfloanrmonthsself legend 'fixedstr( * '%class fixedwithpts(mortgage)def __init__(selfloanrmonthspts)mortgage __init__(selfloanrmonthsself pts pts self paid [loan*(pts/ )self legend 'fixedstr( * '%'str(ptspointsfigure fixed-rate mortgage classes figure contains third subclass of mortgage the class tworate treats the mortgage as the concatenation of two loanseach at different interest rate (since self paid is initialized with it contains one more element than the number of payments that have been made that' why makepayment compares len(self paidto self teasermonths