You can't use it like that. The or
operator must have two boolean operands. You have a boolean and a string. You can write
weather == "Good!" or weather == "Great!":
or
weather in ("Good!", "Great!"):
Especially in the case of python, non empty strings evaluate to True
, so
weather == "Good" or "Great":
will always be true, because "Great" is always true, making it a difficult mistake to spot.
No comments:
Post a Comment