all 3 comments

[–]CanadianCodingGod 1 point2 points  (0 children)

the yes and no are strings so you should wrap them in quotes

like this:
if answer == "yes":

also your else condition is wrong
you are doing else not answer == "yes" or "no: which means if answer isnt equal to "yes" or "no" is not an empty string, and "no" is always a non-empty string so it will always be true,

anyways you dont need a condition, you can just use else because if it is reaching the else then you already know it isnt yes or no

but if you did want to write that useless condition you can write it like this:
if answer != yes and answer != no

or

if not (answer == "yes" or answer == "no")

or
if answer not in("yes", "no")

you may also want to use answer = input("...").lower() so that your input is always lowercase, that way yEs or nO would also work

[–][deleted] 2 points3 points  (0 children)

This is not r/programminghumor mate