While top of ' ops ' has same or greater precedence to current token , which is an operator . Apply operator on top of ' ops ' to top two elements in values stack .
while ( len ( ops ) != 0 and precedence ( ops [ - 1 ] ) >= precedence ( tokens [ i ] ) ) : NEW_LINE INDENT val2 = values . pop ( ) NEW_LINE val1 = values . pop ( ) NEW_LINE op = ops . pop ( ) NEW_LINE values . append ( applyOp ( val1 , val2 , op ) ) NEW_LINE DEDENT