Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT s1 = " a - ( b + c ) " NEW_LINE s2 = " a - ( b - c - ( d + e ) ) - f " NEW_LINE r1 = simplify ( s1 ) NEW_LINE for i in r1 : NEW_LINE INDENT if i != None : NEW_LINE INDENT print ( i , end = " ▁ " ) NEW_LINE DEDENT else : NEW_LINE INDENT break NEW_LINE DEDENT DEDENT print ( ) NEW_LINE r2 = simplify ( s2 ) NEW_LINE for i in r2 : NEW_LINE INDENT if i != None : NEW_LINE INDENT print ( i , end = " ▁ " ) NEW_LINE DEDENT else : NEW_LINE INDENT break NEW_LINE DEDENT DEDENT DEDENT