Chapter 5 Flashcards
modulus operator
an operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.
boolean expression
an expression whose value is either True or False.
relational operator
One of the operators that compares its operands: ==, !=, >, =, and <=.
logical operator
one of the operators that combines boolean expressions: and, or, and not.
conditional statement
a statement that controls the flow of execution depending on some condition.
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.
branch
one of the alternative sequences of statements in a conditional statement.
chained conditional
a conditional statement with a series of alternative branches.
nested conditional
a conditional statement that appears in one of the branches of another conditional statement.
recursion
the process of calling the function that is currently executing.
base case
a conditional branch in a recursive function that does not make a recursive call.
infinite recursion
a recursion that doesn’t have a base case, or never reaches it. Eventually, an infinite recursion causes a runtime error.