Week 3 Flashcards
The Python language is not sensitive to block structuring of code.
False
The if statement causes one or more statements to execute only when a Boolean expression is true.
True
Python allows you to compare strings, but it is not case sensitive.
False
Nested decision statements are one way to test more than one condition.
True
Python uses the same symbols for the assignment operator as for the equality operator.
False
The not operator is a unary operator which must be used in a compound expression.
False
Short -circuit evaluation is only performed with the not operator.
False
Expressions that are tested by the if statement are called Boolean expressions.
True
Decision structures are also known as selection structures.
True
An action in a single alternative decision structure is performed only when the condition is true.
True
A(n) __________ structure is a logical design that controls the order in which a set of statements execute.
a. function
b. control
c. sequence
d. iteration
b. control
The decision structure that has two possible paths of execution is known as
a. single alternative
b. double alternative
c. dual alternative
d. two alternative
c. dual alternative
Multiple Boolean expressions can be combined by using a logical operator to create __________ expressions.
a. sequential
b. logical
c. compound
d. mathematical
c. compound
When using the __________ logical operator, one or both of the subexpressions must be true for the compound expression to be true.
a. or
b. and
c. not
d. maybe
a. or
Which logical operators perform short-circuit evaluation?
a. or, not
b. not, and
c. or, and
d. and, or, not
b. not, and