Using not in Boolean Contexts
00:00
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.
00:24
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 True
or False
.
00:40
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 True
or False
. The others are while
loops.
00:57
These allow for certain sections of code to be repeated provided some Boolean condition remains True
.
Become a Member to join the conversation.