There are two different kinds of OR



The question whether an "or" can also be interpreted as an "and" is a common source of confusion. While as humans we can often resolve this confusion by looking at the context, computers require a strict definition.

In mathematical logic, the foundation of computer science, it is therefore distinguished between "OR" and "exclusive OR". The latter is often abbreviated as XOR. In English, we can express an XOR by using an "either … or …" construction.

The OR operator is always defined as an "and/or". It is fulfilled if at least one of its conditions is fulfilled. It is therefore also called "inclusive or". An "exclusive or" on the other hand is fulfilled if (and only if) exactly one of the conditions is fulfilled. If both of its conditions are met, the "exclusive or" is no longer fulfilled.