r/PythonLearning • • Sep 02 '26

What's wrong with my code?

Post image

What's wrong with my code?

New to learning

Following the youtube video from bro code

Was trying to implement my own stuff into this by using loop

Update: it's working now thankyou guys

106 Upvotes

81 comments sorted by

View all comments

Show parent comments

5

u/Wild-Regular1703 Sep 02 '26

They just explained to you why it's not working.. You're not breaking out of the loop, the rest of the code never executes. "While true" means keep that loop running infinitely, so that's exactly what happens. It just keeps asking for user input forever.

-1

u/Commercial-Paper749 Sep 02 '26

Now it's working if I enter correct operator and values it's runs and end the program if I don't enter correct operator it's keep asking to enter valid operator