Python Chap 4

Ace your homework & exams now with Quizwiz!

In Python the _____ symbol is used as the equality operator

==

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 _____.

Dual Alternative

Python uses the same symbols for the assignment operator and the equality operator.

False

Short-circuit evaluation is performed with the not operator.

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? not (x < y or z > x) and y < z

False

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

True

Decision structures are also known as selection structures

True

Expressions that are tested by the if statement are called Boolean expressions.

True

Nested decision structures are one way to test more than one condition.

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

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

and

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

What does the following expression mean? x <= y

x is less than or equal to y


Related study sets

Chapter 23: Ecological Economics

View Set

Wellness Exam 2 practice questions

View Set

chapter 10- equilibria and equilibrium constant

View Set

Music Test Chapters 6-10 Online Questions

View Set