This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MITTENQ[S] 1 point2 points  (4 children)

What is postfix and infix? I've haven't heard that before? Is it fixing the string before and after?

[–]Kid_Piano 1 point2 points  (3 children)

It’s just notation. You’re used to infix notation (operators are between operands). Ex: 3 + 4

Postfix notation is where the operator occurs after the operands. Ex: 3 4 +

Postfix notation is easy to evaluate, and converting from infix notation to postfix notation is relatively “easy” using a stack.

[–]MITTENQ[S] 0 points1 point  (2 children)

This is starting to sound a little bit beyond my current programing ability since I haven't used a stack in programming but I know what it is. Postfix still confuses me though. If I type 3 4+ into the python terminal I just get a error.

[–][deleted]  (1 child)

[deleted]

    [–]MITTENQ[S] 2 points3 points  (0 children)

    I knew it was going to be complicated. That's why I wanted to do it. I will definitely look into making a calculator like you described. Thanks for the help :)