Chapter 3 - Reading Quiz - CSC121

24 July 2022
4.7 (114 reviews)
35 test answers

Unlock all answers in this set

Unlock answers (31)
question
A(n) ________ structure is a logical design that controls the order in which a set of statements execute.
answer
control
question
The decision structure that has two possible paths of execution is known as
answer
Dual alternative
question
Multiple Boolean expressions can be combined by using a logical operator to create ________ expressions.
answer
Compound
question
When using the ________ logical operator, one or both of the subexpressions must be true for the compound expression to be true.
answer
or
question
Which logical operators perform short-circuit evaluation?
answer
not, and
question
A Boolean variable can reference one of two values which are
answer
True/False
question
Which of the following is the correct if clause to determine whether choice is anything other than 10?
answer
if choice != 10:
question
When using the ________ logical operator, both subexpressions must be true for the compound expression to be true.
answer
and
question
In Python the ________ symbol is used as the not-equal-to operator.
answer
!=
question
In Python the ________ symbol is used as the equality operator.
answer
==
question
Which of the following will hide the turtle if it is visible?
answer
if turtle.isvisible(): turtle.hideturtle()
question
Which of the following will determine if the turtle's pen is up and will change it to down if that is the case?
answer
if not(turtle.isdown()): turtle.pendown()
question
The Python language is not sensitive to block structuring of code. T/F
answer
False
question
The if statement causes one or more statements to execute only when a Boolean expression is true. T/F
answer
True
question
Python allows you to compare strings, but it is not case sensitive. T/F
answer
False
question
Nested decision statements are one way to test more than one condition. T/F
answer
True
question
Python uses the same symbols for the assignment operator as for the equality operator. T/F
answer
False
question
The not operator is a unary operator which must be used in a compound expression. T/F
answer
False
question
Short -circuit evaluation is only performed with the not operator. T/F
answer
True
question
Expressions that are tested by the if statement are called Boolean expressions. T/F
answer
True
question
Decision structures are also known as selection structures. T/F
answer
True
question
An action in a single alternative decision structure is performed only when the condition is true. T/F
answer
True
question
The following statement will check to see if the turtle's pen color is 'green': if turtle.pencolor() = 'green' T/F
answer
False
question
The following code snippet will change the turtle's pen size to 4 if it is presently less than 4: if turtle.pensize() < 4: turtle.pensize(4) T/F
answer
True
question
statement is used to create a decision structure.
answer
if
question
symbol is used to represent a Boolean expression.
answer
Diamond
question
decision structure provides only one alternative path of execution.
answer
Single alternative
question
executed because it is performed only when a specific condition is true.
answer
conditionally
question
operator determines whether a specific relationship exists between two values.
answer
relational
question
statement will execute one block of statements if its condition is true or another block if its condition is false.
answer
if-else
question
Python provides a special version of a decision structure known as the ___________ statement, which makes the logic of the nested decision structure simpler to write.
answer
if-elif-else
question
The logical _______________ operator reverses the truth of a Boolean expression.
answer
not
question
Boolean variables are commonly used as _______________ to indicate whether a specific condition exists.
answer
flags
question
expression is made up of two or more Boolean expressions.
answer
compound
question
The turtle.isdown() function returns _____________ if the turtle's pen is down.
answer
true