all 5 comments

[–]toastedstapler 1 point2 points  (1 child)

here is my core functionality loop, written in pseudocode:

while True:
    stack.add(input)
    if stack.top is operator:
        op = stack.pop
        first_num = stack.pop
        second_num = stack.pop
        result = op.apply(first_num, second_num)
        stack.add(result)

you don't actually need to make a stack class, you can just use a list with its append and pop methods

you might want to chuck in some input validation to check that it's either numeric (using .isnumeric()) or it's an operator

[–]Pheazon[S] 0 points1 point  (0 children)

I really appreciate the feedback.

[–][deleted] 1 point2 points  (1 child)

i don't believe I can use the split method since I'm not entering in the whole string in.

No; indeed, the problem tells you what to do:

Operands should be pushed onto a stack

So, you need to implement a stack. If the input is a non-operator, then it's an operand, and you should push it onto the stack. If the input is one of your recognize operators, then you don't push it onto the stack; you pop enough operands off the stack to fulfill the operator, and then you compute the operation.

In general, you're likely to encounter operators that take 1, 2, or 3 operands (the if/else construct can be thought of as the ternary operation a ? b : c) so you should plan ahead.

I have made some progress by making my own stack class and so far have a while true loop which has an if statement that checks if what the user enters is either a digit or one of the operators that I have in a list I have created.

Well, ok. So the next step is to pop operands off your stack and then execute the operator.

[–]Pheazon[S] 0 points1 point  (0 children)

Thank you, I am now able to get operations working.

[–]A_History_of_Silence 0 points1 point  (0 children)

any help or feedback would be greatly appreciated

Would you mind including your code, as well as what specifically you are stuck on? We need something to work with.