Boolean Logic Relating to Python
Here’s some terminology relevant to Boolean logic in Python. Boolean is a type of value that can be either
False. We signify that using the keyword
bool for that type, and it’s a subtype of the
int (integer) type. There are two Boolean values,
False, and in Python those are capitalized.
A Boolean variable is a variable that can have a Boolean value—specifically, either
False. We usually use Boolean variables to indicate if a specific condition is present at a particular time within the running of our program.
A Boolean context is a place where a Boolean expression is expected, such as in an
if condition or a
while condition. They determine which branch of a selection statement we go into or whether we perform an additional iteration of a
01:22 Operands are individual parts of larger expressions. If you’re adding two numbers, each number is called an operand. The Boolean logic operators of AND and OR both use two operands and the NOT operation uses a single operand.
Become a Member to join the conversation.