COMSC20 Ch. 4 - Conditionals
block.
π
A group of consecutive statements with the same indentation.
body.
π
The block of statements in a compound statement that follows the header.
boolean expression.
π
An expression that evaluates to either True or False.
boolean function.
π
A function that returns a boolean value. The only possible values of the bool type are False and True.
boolean value.
π
There are exactly two boolean values: True and False. Boolean values result when a boolean expression is evaluated by the Python interepreter. They have type bool.
branch.
π
One of the possible paths of the flow of execution determined by conditional execution.
chained conditional.
π
A conditional branch with more than two possible flows of execution. In Python chained conditionals are written with if ... elif ... else statements.
comparison operator.
π
One of the operators that compares two values: ==, !=, >, <, >=, and <=.
condition.
π
The boolean expression in a conditional statement that determines which branch is executed.
conditional statement.
π
A statement that controls the flow of execution depending on some condition. In Python the keywords if, elif, and else are used for conditional statements.
logical operator.
π
One of the operators that combines boolean expressions: and, or, and not.
modulus operator.
π
An operator, denoted with a percent sign ( %), that works on integers and yields the remainder when one number is divided by another.
nesting.
π
One program structure within another, such as a conditional statement inside a branch of another conditional statement.