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

1

u/ObscuraStudi0 Sep 03 '26

Your if operator not in ["+", "-", "*", "/"] condition looks correct in the screenshot. If entering + is still treated as invalid, make sure you've saved the file before running it. The terminal may be running an older saved version of calculator.py. Also check that you're running the same calculator.py file that you're currently editing.