cs 102 chapter 3 quiz

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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

!=

Which of the following will hide the turtle if it is visible?

if turtle.isvisible(): turtle.hideturtle()

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:

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

true

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

true

t/f Nested decision statements are one way to test more than one condition.

true

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

true

When using the ________ logical 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

dual alternative

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

false

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 will determine if the turtle's pen is up and will change it to down if that is the case?

if not(turtle.isdown()): turtle.pendown()

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 Boolean variable can reference one of two values which are

true or false

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

==

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

false

t/f The following statement will check to see if the turtle's pen color is 'green':if turtle.pencolor() = 'green'

false

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

false

t/f 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 does the following expression mean?x <= y

x is less than or equal to y


संबंधित स्टडी सेट्स

Year 9 Spanish 40 Words List Module 1

View Set

Stroke, Intracranial Pressure, Increased Intracranial Pressure, HIV, Conflict Resolution

View Set

Med Surge Multiple Sclerosis & Spinal Cord injury

View Set