Using not in Boolean Contexts
In the next few lessons, you’ll start to see places where the
not operator is commonly used, beginning with Boolean contexts.
00:10 Normally, the instructions in your program progress one after the other, but sometimes you want to change that. There are times a certain piece of code should only be executed if some condition is true, and other sections of code that should be repeated.
Statements which cause this to happen are called control flow statements because they control the flow, the order, that other statements are executed. To make these determinations, they use a Boolean condition, which is evaluated to
So these are considered the Boolean contexts where a
not operator might be used. The first are
if statements. These allow a certain section of code to be executed based on some Boolean condition being
False. The others are
These allow for certain sections of code to be repeated provided some Boolean condition remains
Become a Member to join the conversation.