It's because:
if word == "A" or "B":
isn't the same as
if word == "A" or word == "B":
The first evaluates (is word == "A") logical_or ("B")
So the first version always evaluations to true. Here's an example:
>>> X = "asdf"
>>> if(X):
... print("hurray")
...
hurray
>>>