Python postfix Calculator Questions

Asked 1 years ago, Updated 1 years ago, 61 views

I made a postfix calculator with Python, and the result came out weird The first line is a formula The second line is the output of the infix converted into a postfix In the last line, the result value of the formula should be calculated, but it's printed strangely... The numbers are coming out well in the posterior notation, but the operator part is being printed strangely and the result is the sameWhy is it like this?ㅜㅜ<

Please enter the formula according to the above conditions: 36*(4+5)/9 Posterior notation: 364 5 9 Calculation results: I wrote that, but when the post goes up, I can't see the error in the post Please refer to the picture!!

python infix postfix calculator

2022-09-22 18:29

1 Answers

The questions are a bit confusing. I think you need to tell me the exact code so that I can answer.

The reason <built-in method pop of something> appears on the output screen is because the function is output, not the return value of the function.

In the code you are output,

Make sure that list-type variable.pop() is not included, but list-type variable.pop is not included. It's going to be written up to .pop without brackets. If you put brackets on the back, I think you'll see the normal value.


2022-09-22 18:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.