Chapter 15 - Concept Summary¶
Chapter 15 included the following concepts from computing.
- Condition - A condition is something that is either true or false. This is also called a Boolean expression or a logical expression.
- Conditional Execution - Conditional execution means that one or more statements are executed only when a condition (logical expression) is true. This is also called a conditional. The statements that are executed when the condition is true are called the body of the loop.
- Decision - A decision is a choice between at least two choices.
- Edge Detection - Edge detection is a image processing technique. It finds the “edges” in an image which are the areas of high constrast or where the color changes.
- Posterize - Posterize means to reduce the number of colors in an image so that it looks like a poster.
Summary of Python Keywords and Functions¶
- And - The keyword
and
is used to join two logical expressions and then both of the logical expressions must be true for the joined expression to be true. - Else - The keyword
else
is used to execute one or more statements in a block following theelse
when the condition in theif
part of the statement is false. Anelse
must always have anif
statement before it. - Elif - The keyword
elif
is used when you want to have a conditional with 3 or more possibile options. Add as manyelif
statements as you need after anif
and before aelse
. - If - The Python keyword
if
is used to start a condition. It is followed by a Boolean expression and then has one or more statements in the body of the loop that are executed only if the Boolean expression is true. - Not - The keyword
not
is used to negate a logical expression. If the original expression is true the negated expression is false and if the original expression is false the negated expression is true.