class tworate(mortgage)def __init__(selfloanrmonthsteaserrateteasermonths)mortgage __init__(selfloanteaserratemonthsself teasermonths teasermonths self teaserrate teaserrate self nextrate / self legend str(teaserrate* )'for str(self teasermonths)monthsthen str( * '%def makepayment(self)if len(self paid=self teasermonths self rate self nextrate self payment findpayment(self owed[- ]self rateself months self teasermonthsmortgage makepayment(selffigure mortgage with teaser rate figure contains function that computes and prints the total cost of each kind of mortgage for sample set of parameters it begins by creating one mortgage of each kind it then makes monthly payment on each for given number of years finallyit prints the total amount of the payments made for each loan def comparemortgages(amtyearsfixedrateptsptsratevarrate varrate varmonths)totmonths years* fixed fixed(amtfixedratetotmonthsfixed fixedwithpts(amtptsratetotmonthsptstworate tworate(amtvarrate totmonthsvarrate varmonthsmorts [fixed fixed tworatefor in range(totmonths)for mort in mortsmort makepayment(for in mortsprint print total payments $str(int( gettotalpaid())comparemortgages(amt= years= fixedrate= pts ptsrate= varrate = varrate = varmonths= figure evaluate mortgages notice that we used keyword rather than positional arguments in the invocation of comparemortgages we did this because comparemortgages has large number of formal parameters and using keyword arguments makes it easier to ensure that we are supplying the intended actual values to each of the formals