HW Ch.3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

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

!=

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

==

Python allows you to compare strings, but it is not case sensitive.

False

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

False

Short -circuit evaluation is only performed with the not operator.

False

The Python language is not sensitive to block structuring of code.

False

The not operator is a unary operator which must be used in a compound expression.

False

What is the result of the following Boolean expression, given that x = 5, y = 3, and z = 8? x < y and z > x

False

What is the result of the following Boolean expression, given that x = 5, y = 3, and z= 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 statements are one way to test more than one condition.

True

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, given that x = 5, y = 3, and z = 8? x < y or z > x

True

A Boolean variable can reference one of two values which are

True or False

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

and

A(n) ________ expression is made up of two or more Boolean expressions.

compound

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

In flowcharting, the ________ symbol is used to represent a Boolean expression.

diamond

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

dual alternative

The _____ statement is used to create a decision structure.

if

Which of the following is the correct if clause to determine whether choice is anything 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, inclusive?

if y >= 10 and y <= 50:

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.

if-elif-else

A(n) ________ statement will execute one block of statements if its condition is true or another block if its condition is false.

if-else

The logical ________ operator reverses the truth of a Boolean expression.

not

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

or

Which logical operators perform short-circuit evaluation?

or, and

A(n) ________ decision structure provides only one alternative path of execution.

single alternative

What does the following expression mean? x <= y

x is less than or equal to y


Kaugnay na mga set ng pag-aaral

5.1 (Basic concepts in probability)

View Set

Intro to Business Law Chapter 17,18, and 19

View Set

Section 17: Book Chapter 20 - Wireless Networking

View Set

Domain I: Initial Client Consultation and Assessment

View Set

ECE Fund of Cybersecurity and Info Security: Ch 13 and 14

View Set