3.8. Glossary


A variable used in a loop to add up or accumulate a result.


The sequence of statements within a compound statement.

boolean expression

An expression whose value is either True or False.


One of the alternative sequences of statements in a conditional statement.

chained conditional

A conditional statement with a series of alternative branches.

comparison operator

One of the operators that compares its operands: ==, !=, >, <, >=, and <=.

conditional statement

A statement that controls the flow of execution depending on some condition.


The boolean expression in a conditional statement that determines which branch is executed.

compound statement

A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.


A variable used in a loop to count the number of times something happened. We initialize a counter to zero and then increment the counter each time we want to “count” something.

guardian pattern

Where we construct a logical expression with additional comparisons to take advantage of the short-circuit behavior.


An assignment that gives an initial value to a variable that will be updated.

infinite loop

A loop in which the terminating condition is never satisfied or for which there is no terminating condition.


Repeated execution of a set of statements using either a function that calls itself or a loop.

logical operator

One of the operators that combines boolean expressions: and, or, and not.

nested conditional

A conditional statement that appears in one of the branches of another conditional statement.