exam 2 Flashcards
a ____ is a sequence of statements only executed under a certain condition.
branch
An ____ branch is a branch taken only if an expression is true.
if
An ____ branch has two branches: The first branch is executed if an expression is true, else the other branch is executed.
if-else
The ____ evaluates to True if the left and right sides are equal.
equality operator (==)
The ____ evaluates to True if the left and right sides are not equal, or different.
inequality operator (!=)
A ____ is a type that has just two values: True or False.
Boolean
A ____ checks how one operand’s value relates to another.
relational operator
Python supports ____. For example, a < b < c determines whether b is greater-than a but less-than c.
operator chaining
A ____ treats operands as being True or False, and evaluates to True or False.
logical operator
Logical operators include ____, ____, and ____.
AND, OR, NOT
____: True when its one operand is False, and vice versa.
Logical NOT
____: True when at least one of its two operands are True.
Logical OR
____: True when both of its operands are True.
Logical AND
A branch’s statements can include any valid statements, including another if-else statement, which are known as ____ statements.
nested if-else
The order in which operators are evaluated in an expression is known as precedence rules. ____, ____, and ____operators are evaluated in what order.
Arithmetic, relational, logical
A ____ is a series of statements grouped together.
code block
____ is any blank space or newline
whitespace
Program redundancy can be reduced by creating a grouping of predefined statements for repeated operations, known as a ____.
function
A ____ is a named series of statements.
function