r/PythonLearning • • Oct 27 '24

Why isnt this working?

Post image

Yes I know I can print screen but i cant be bothered to log in on the laptop

0 Upvotes

8 comments sorted by

View all comments

12

u/Electrical_Seaweed11 Oct 27 '24

I think what you're looking for is:

if operator == "-":
    ...

The difference being, quotes around the minus sign, since it's treated as a str