OR Comparisons

What happens when we use the word or between comparisons?

As long as at least one part of the comparison is True, the whole expression is considered True.

Let's think back to our supermarket example:

You can pay with cash OR a card OR by contactless - as long as you have at least one of those things, you can buy your cheese.

If both are True:


>>> 1==1 or 2==2

True


If only one is True:


>>> 1==1 or 2==3

True


But if both are False, then the whole thing is False:


>>> 1==2 or 2==3

False