def AF(self):
        """Compute the annuity factor of two values"""
        
        if self.r_1<0 or self.r_2 < 0 or self.n<0:
            raise MinusSignError,\
              "\n<Rates values and period number should be positive"
        try:
            
            annuity_factor_1 = "%2.3f" %((1-((m.pow((1+self.r_1),-self.n))))/self.r_1)
            annuity_factor_2 = "%2.3f" %((1-((m.pow((1+self.r_2),-self.n))))/self.r_2)

            return (annuity_factor_1,annuity_factor_2)

        #AF raises Zero division number error 
        except ZeroDivisionError:
            print "\n<Please choose a rate value greater than zero"

        #AF raises Negative number error    
        except MinusSignError,exception:
            print exception
Compute the annuity factor of two values
recipes/Python/576683_IRRVersusNPV_26/recipe-576683.py