コード例 #1
0
 def important (self, operand1, operand2):
     '''
     product owner said should only work for positive numbers reutnred from micro.plus
     '''
     answer = micro.plus(operand1, operand2)
     if answer < 0:
         raise ValueError     
     else:
         return "Answer: {}".format(micro.plus(operand1, operand2))
コード例 #2
0
    def important(self, operand1, operand2):
        try:
            answer = micro.plus(operand1, operand2)
        except ValueError:  # print nice message if micro.plus flips a table
            return "Plus method failed for undefined reason"

        if answer < 0:
            raise ValueError(
            )  # this method Flip table if the answer is negative
        else:
            return "Answer: {}".format(answer)
コード例 #3
0
    def important(self, operand1, operand2):
        '''
        Hey. Product owner said, this should only work for
        positive numbers returned from micro.plus
        '''
        try:
            answer = micro.plus(operand1, operand2)
        except ValueError:  # print nice message if micro.plus flips a table
            return "Plus method failed for undefined reason"

        if answer < 0:
            raise ValueError(
            )  # this method Flip table if the answer is negative
        else:
            return "Answer: {}".format(answer)
コード例 #4
0
def another_important_func():
    return "Answer: {}".format(micro.plus(1, 3))