How the Python or Operator Works
In your preceding lessons, we got a bit of a background about Boolean logic and some of the terms that apply to Boolean operators in Python. In this next set of lessons, we’ll actually take a look at how Python uses the
00:25 This is sometimes referred to as the inclusive OR. It leads to a little bit of confusion because in English the word “or” can have two meanings. Sometimes when we say “or” we mean one or the other but not both.
That’s called the exclusive OR. But in Boolean algebra, Boolean logic, and the way Python understands the word
or, we use the inclusive OR, which means all we need is at least one of the two expressions to be
True. If they’re both
or of those two expressions is also
Become a Member to join the conversation.