Chapter 7 - Definitions Flashcards
Define block
A group of consecutive statements w/the same indentation
Define body
The block of statements in a compound statement that follows the header
Define boolean expression
An expression that is either true or false
Define boolean function
A fxn that returns a boolean value. The only possible values of the bool type are False and True
Define boolean value
There are exactly 2 boolean values: True and False. Boolean values result when a boolean expression is evaluated by the Python interpreter. They have type bool.
Define branch
One of the possible paths of flow of execution determined by conditional execution
Define chained conditional
A conditional branch with more than 2 possible flows of execution. In Python chained conditionals are written with if… elif… else statements
Define comparison operator
One of the operators that compares 2 values: ==, !=, >, =, and <=
Define condition
The boolean expression in a conditional statement that determines which branch is executed
Define 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
Define logical operator
One of the operators that combines boolean expressions: and, or, and not
Define modulus operator
An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another
Define nesting
One program structure within another, such as a conditional statement inside a branch of another conditional statement