Reviewing How the Python or Operator Works
But because of the way it’s implemented, we can use it on other things. We can use it on objects, where if the first object evaluates to be
True, we get the first object and if the first object evaluates to be
False, we get the second object.
And it actually won’t evaluate the second operand unless it needs to. If the first operand proves to be
True, there’s no reason to continue the operation because we know the whole thing is going to be
So now that we know syntactically how to connect two expressions with the word
or and what the result of that operation will be, the next few lessons will take a look at where we use
or statements within our Python programs.
Become a Member to join the conversation.