is pushed onto operandsand the final on operators is applied to stacked operands the text input and display field at the top of the gui' main window plays part in this algorithmtoo the text input field and expression stacks are integrated by the calculator class in generalthe text input field always holds the prior operand when an operator button is pressed ( on *)the text in the input field is pushed onto the operands stack before the operator is resolved because of thiswe have to pop results before displaying them after "evalor is pressedotherwise the results are pushed onto the stack twice--they would be both on the stack and in the display fieldfrom which they would be immediately pushed again when the next operator is input for both usability and accuracywhen an operator is seenwe also have to arrange to erase the input field' prior value when the next operand' entry is started ( on both and in this erasure of the prior values is also arranged when "evalor is appliedon the assumption that subsequent operand key or button replaces the prior result--for new expression after "eval,and for an operand following new operator after ) to erase the parenthesized result on in ( without this erasureoperand buttons and keys simply concatenate to the currently displayed value this model also allows user to change temporary result operands after by entry of operand instead of operator expression stacks also defer operations of lower precedence as the input is scanned in the next tracethe pending isn' evaluated when the button is pressedsince binds tighterwe need to postpone the until the can be evaluated the operator isn' popped until its right operand has been seen there are two operators to pop and apply to operand stack entries on the "evalpress--the at the top of operators is applied to the and at the top of operandsand then is run on and the pushed for * entered keys" [result (['+''*'][' '' '' '](['+'][' '' '][on 'evalpress[displays " "for strings of same-precedence operators such as the followingwe pop and evaluate immediately as we scan left to rightinstead of postponing evaluation this results in left-associative evaluationin the absence of parentheses + + is evaluated as (( + )+ for and operations this is irrelevant because order doesn' matter entered keys" [result (['+'][' '' '](['+'][' '' '][on the second '+'[on 'eval'the following trace is more complex in this caseall the operators and operands are stacked (postponeduntil we press the button at the end to make parentheses workis given higher precedence than any operator and is pushed onto the operators stack to seal off lower stack reductions until the is seen when the button is pressedthe pycalca calculator program/object