In Python, I’ve begun to solve Data Structure difficulties. I’m converting from infix to postfix, however I’m having trouble debugging a mistake in my software. The last return statement, when I do the join operation, contains NONE input.
When I started debugging, I saw that something is incorrect in this section of code following the first push operation (for *). After that, whenever I call pop(), it returns NONE instead of *. Could someone please point out what is wrong here?
*else:
while (not s.isEmpty()) and (prec[s.peek()] >= prec[token]):
#print token
outlst.append(s.pop())
#print outlst
s.push(token)
print (s.peek())*