def evaluateExpressionTree(rootNode):
    if (rootNode is None):
        return 0
    if ((rootNode.left is None) and (rootNode.right is None)):
        return int(rootNode.value)
    leftSubtreeValue = evaluateExpressionTree(rootNode.left)
    rightSubtreeValue = evaluateExpressionTree(rootNode.right)
    if (rootNode.value == '+'):
        return (leftSubtreeValue + rightSubtreeValue)
    elif (rootNode.value == '-'):
        return (leftSubtreeValue - rightSubtreeValue)
    elif (rootNode.value == '*'):
        return (leftSubtreeValue * rightSubtreeValue)
    elif (rootNode.value == '^'):
        return (leftSubtreeValue ** rightSubtreeValue)
    elif (rootNode.value == '/'):
        return (leftSubtreeValue / rightSubtreeValue)
def evaluateExpressionTree(rootNode):
    if (rootNode is None):
        return 0
    if ((rootNode.left is None) and (rootNode.right is None)):
        return int(rootNode.value)
    leftSubtreeValue = evaluateExpressionTree(rootNode.left)
    rightSubtreeValue = evaluateExpressionTree(rootNode.right)
    if (rootNode.value == '+'):
        return (leftSubtreeValue + rightSubtreeValue)
    elif (rootNode.value == '-'):
        return (leftSubtreeValue - rightSubtreeValue)
    elif (rootNode.value == '*'):
        return (leftSubtreeValue * rightSubtreeValue)
    elif (rootNode.value == '^'):
        return (leftSubtreeValue ** rightSubtreeValue)
    elif (rootNode.value == '/'):
        return (leftSubtreeValue / rightSubtreeValue)