Python 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.
booleanexpression:
AnexpressionwhosevalueiseitherTrueorFalse. relationaloperator: Oneoftheoperatorsthatcomparesitsoperands:==,!=,>,=,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 condi- tion.
condition:
The boolean expression in a conditional statement that determines which branch is exe- cuted.
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 condi- tional 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.