Python Chapter 3
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
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 decision structure that has two possible paths of execution is known as:
dual alternative
Which of the following will hide the turtle if it's visible?
if turtle.isvisible(): turtle.hideturtle()
What is the result of the following Boolean expression, given that x=5, y=3, z=8? not(x<y OR z>x) AND y<z
False
The NOT operator is a unary operator which must be used in a compound expression.
False
The Python language is not sensitive to block structuring of code.
False
What is the result of the following Boolean expression, given that x=5, y=3, z=8? x<y AND z>x
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, given that x=5, y=3, 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
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
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's the case?
if not(turtle.isdown()): turtle.pendown()
Which of the following is the correct if clause to determine whether y is in the range of 10 through 50, inclusive?
if y>=10 and y<=50:
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
What does the following expression mean? x<=y
x is less than or equal to y