def getBracketsExist(evaluators):
 bracketBeginIndex = None
 for negativeIndex in xrange((- len(evaluators)), 0):
  bracketEndIndex = (negativeIndex + len(evaluators))
  evaluatorEnd = evaluators[bracketEndIndex]
  evaluatorWord = evaluatorEnd.word
  if (evaluatorWord in ['(', '[', '{']):
   bracketBeginIndex = bracketEndIndex
  elif (evaluatorWord in [')', ']', '}']):
   if (bracketBeginIndex == None):
    print 'Warning, bracketBeginIndex in evaluateBrackets in evaluate is None.'
    print 'This may be because the brackets are not balanced.'
    print evaluators
    del evaluators[bracketEndIndex]
    return
   evaluators[bracketBeginIndex].executeBracket(bracketBeginIndex, bracketEndIndex, evaluators)
   evaluators[bracketBeginIndex].word = None
   return True
 return False

def getBracketsExist ( evaluators ) : bracketBeginIndex = None for negativeIndex in xrange ( ( - len ( evaluators ) ) , 0 ) : bracketEndIndex = ( negativeIndex + len ( evaluators ) ) evaluatorEnd = evaluators [ bracketEndIndex ] evaluatorWord = evaluatorEnd . word if ( evaluatorWord in [ '(' , '[' , '{' ] ) : bracketBeginIndex = bracketEndIndex elif ( evaluatorWord in [ ')' , ']' , '}' ] ) : if ( bracketBeginIndex == None ) : print 'Warning, bracketBeginIndex in evaluateBrackets in evaluate is None.' print 'This may be because the brackets are not balanced.' print evaluators del evaluators [ bracketEndIndex ] return evaluators [ bracketBeginIndex ] . executeBracket ( bracketBeginIndex , bracketEndIndex , evaluators ) evaluators [ bracketBeginIndex ] . word = None return True return False
evaluate the expression value .