Chapter 3 Quiz Questions

Ace your homework & exams now with Quizwiz!

In Python, the _____ symbol is used as the not-equal-to operator.

!=

In Python the _____ symbol is used as the equality operator.

==

When using the _____ operator, both subexpressions must be true for the compound expression to be true.

and

Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions.

compound

A(n) _____ structure is a logical design that controls the order in which a set of statements execute.

control

The decision structure that has two possible paths of execution is known as _____.

double alternative

True/False: Python allows you to compare strings, but it is not case sensitive.

false

True/False: Python uses the same symbols for the assignment operator and the equality operator.

false

True/False: Short-circuit evaluation is performed with the not operator.

false

True/False: The Python language is not sensitive to block structuring of code.

false

True/False: The not operator is a unary operator and it must be a compound expression.

false

What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?

false

What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8? not (x < y or z > x) and y < z

false

Which of the following is the correct if clause to use to determine whether choice is other than 10?

if choice != 10:

Which of the following is the correct if clause to determine whether y is in the range 10 through 50?

if y > 10 and y < 50

When using the _____ operator, one or both subexpressions must be true for the compound expression to be true.

or

Which logical operators perform short-circuit evaluation?

or, and

True/False: An action in a single alternative decision structure is performed only when the condition is true.

true

True/False: Decision structures are also known as selection structures.

true

True/False: Expressions that are tested by the if statement are called Boolean expressions.

true

True/False: Nested decision structures are one way to test more than one condition.

true

True/False: The if statement causes one or more statements to execute only when a Boolean expression is true.

true

What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8? x < y or z > x

true

A Boolean variable can reference one of two values: _____.

true or false

What does the following expression mean? x <= y

x is less than or equal to y


Related study sets

PSY 360 - Chapter 8: Introduction To Hypothesis Testing

View Set

SMALL BUSINESS MANAGEMENT - CHAPTER 6 - SMALL BUSINESS MARKETING

View Set