python_data_scien/poc2/ArithmeticExpression_tree.py
def run_example():
    """
    Create and evaluate some examples of arithmetic expressions
    """

    one = ArithmeticExpression("1", [])
    two = ArithmeticExpression("2", [])
    three = ArithmeticExpression("3", [])
    print one
    print one.evaluate()
    
    one_plus_two = ArithmeticExpression("+", [one, two])
    print one_plus_two
    print one_plus_two.evaluate()
    
    one_plus_two_times_three = ArithmeticExpression("*", [one_plus_two, three])
    print one_plus_two_times_three
    
    import poc_draw_tree
    poc_draw_tree.TreeDisplay(one_plus_two_times_three)
    print one_plus_two_times_three.evaluate()

    Create and evaluate some examples of arithmetic expressions
    
Create and evaluate some examples of arithmetic expressions
Create and evaluate some examples of arithmetic expressions
def run_example():
    one = ArithmeticExpression("1", [])
    two = ArithmeticExpression("2", [])
    three = ArithmeticExpression("3", [])
    print one
    print one.evaluate()
    one_plus_two = ArithmeticExpression("+", [one, two])
    print one_plus_two
    print one_plus_two.evaluate()
    one_plus_two_times_three = ArithmeticExpression("*", [one_plus_two, three])
    print one_plus_two_times_three
    import poc_draw_tree
    poc_draw_tree.TreeDisplay(one_plus_two_times_three)
    print one_plus_two_times_three.evaluate()
def run_example ( ) : one = ArithmeticExpression ( "1" , [ ] ) two = ArithmeticExpression ( "2" , [ ] ) three = ArithmeticExpression ( "3" , [ ] ) print one print one . evaluate ( ) one_plus_two = ArithmeticExpression ( "+" , [ one , two ] ) print one_plus_two print one_plus_two . evaluate ( ) one_plus_two_times_three = ArithmeticExpression ( "*" , [ one_plus_two , three ] ) print one_plus_two_times_three import poc_draw_tree poc_draw_tree . TreeDisplay ( one_plus_two_times_three ) print one_plus_two_times_three . evaluate ( )
Create and evaluate some examples of arithmetic expressions
Create and evaluate some examples of arithmetic expressions
"""
    Create and evaluate some examples of arithmetic expressions
    """