defexpressionToRPN(ex):priority={"+":2,"-":2,"*":3,"/":3}operatorStack=[]outputQueue=[]elements=expressionToList(ex)whilelen(elements)>0:element=elements.pop(0)# element is a numberiftype(element)==int:outputQueue.append(element)continue# element is an operatorwhilelen(operatorStack)!=0andpriority[operatorStack[-1]]>=priority[element]:outputQueue.append(operatorStack.pop())operatorStack.append(element)whilelen(operatorStack)>0:outputQueue.append(operatorStack.pop())returnoutputQueueif__name__=='__main__':print(expressionToRPN('2+3*4'))# Output: [2, 3, 4, '*', '+']