Python Boolean Operators
00:00 Now let’s take a look at how Python implements the Boolean operators.
00:05
If you’re coming from another language like JavaScript, Java, C#—any of the descendants of C—you’re probably familiar with using these symbols: the two ampersands (&&
) for AND, the two vertical bars (||
) for OR, and the exclamation point (!
) for NOT.
00:21
Python actually uses the keywords written in English: and
, or
, and not
. You would simply use those to separate your two expressions for and
and or
, or put not
in front of another expression to do its negation.
00:37
In the next set of lessons, we’ll take a look at some examples on how you would write expressions using the operator or
.
Become a Member to join the conversation.