Chapter 5 Conditionals and Recursion Flashcards
Floor Divison
An operator, denoted //, that divides two numbers and round down (toward negative infinity) to an integer
Modulus Operator
An operator, denoted with a percent sign (%), that works on integers and returns 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 runs.
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.
Return Statement
A statement that causes a function to end immediately and return to the caller.
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 does not have a base case, or never reaches it. Eventually, an infinite recursion causes a runtime error.