[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Basic Zope Objects

webmaster at zope.org webmaster at zope.org
Fri Nov 14 00:14:43 EST 2003


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/BasicObject.stx#3-78

---------------

      Now, revisit the Contents view of the *Interest* folder and create
      a Script (Python) object with the id
      *calculateCompoundingInterest* that accepts four parameters:
      'principal', 'interest_rate', 'periods' and 'years'.  Provide it
      with the following "body"::

        """ 
        Calculate compounding interest.
        """
        i = interest_rate / periods
        n = periods * years
        return ((1 + i) ** n) * principal 

        % SlowCorners - Nov. 14, 2003 12:14 am:
         A minimal error in the header; 'i' missing.



More information about the ZDP mailing list