1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Python infix to postfix conversion

Discussion in 'Programming' started by Ferris D Morris, Jul 12, 2022.

  1. #1
    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())*
    Code (markup):
    Source: Scaler
     
    Last edited: Oct 20, 2022
    Ferris D Morris, Jul 12, 2022 IP
  2. salvados guira

    salvados guira Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    my son is very good for you problem, i speak him and he found your solution i send you
     
    salvados guira, Jul 19, 2022 IP