create an empty stack create an empty list to represent the postfix expression for each token in the expression: if token is a number: append it onto the postfix expression elif token is a left parenthesis: push it onto the stack elif token is an operator: while (stack is not empty and the top stack item is an operator with precedence greater than or equal to token): pop and append the operator onto the postfix expression push the token onto the stack else token must be a right parenthesis: while the top item on the stack is not a left parenthesis: pop item from the stack and append it onto the postfix expression pop the left parenthesis while the stack is not empty: pop an item from the stack and append it onto the postfix expression