string calculator Python with priority of actions in parens without using eval() with input history in Object-oriented programming style