Exam 3: Loops and Selection Statements

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

When the step argument is a negative number, the range function generates a sequence of numbers from the first argument down to the second argument plus 1.

(True/False)
4.9/5
(27)

What statement regarding precedence of operators is accurate?

(Multiple Choice)
4.7/5
(39)

What comparison operator is used to test whether an expression does NOT equal another expression?

(Multiple Choice)
4.8/5
(40)

Some computer scientists argue that a while True loop with a delayed exit violates the spirit of the while loop.

(True/False)
4.9/5
(40)

What function call will generate a random number in the range of 1 through 6 using the random module?

(Multiple Choice)
4.8/5
(44)

Although the while loop can be complicated to write correctly, it is possible to simplify its structure and thus improve its readability.

(True/False)
4.7/5
(33)

The assignment symbol can be combined with the arithmetic and concatenation operators to provide augmented assignment operations.

(True/False)
4.7/5
(36)

The not operator expects a single operand and returns its logical negation, True, if it's false, and False if it's true.

(True/False)
4.9/5
(42)

The comparison operators are applied after addition but before assignment.

(True/False)
4.8/5
(28)

You are running a Python script and suspect that the script has entered an infinite loop. What key combination can you use to halt the loop?

(Multiple Choice)
4.9/5
(35)

What part of the loop comprises the statements to be executed?

(Multiple Choice)
4.9/5
(40)

What scenario would it make logical sense to use a multi-way selection statement for?

(Multiple Choice)
4.9/5
(34)

Given the following statement: "%4d" % var1, which of the following is accurate?

(Multiple Choice)
4.9/5
(40)

What statement should you use to print the value of total with a precision of 5 digits?

(Multiple Choice)
4.9/5
(38)

The simplest form of selection is the if-else statement.

(True/False)
4.8/5
(26)

What is NOT a Boolean or logical operator used in the Python language?

(Multiple Choice)
4.9/5
(32)

The Boolean data type is named for the twentieth-century British mathematician George Boole.

(True/False)
4.9/5
(34)

Conditional iteration requires that a condition be tested within the loop to determine whether the loop should continue.

(True/False)
4.8/5
(30)

The not operator has a lower precedence than the and and or operators.

(True/False)
4.9/5
(44)

4 != 4 evaluates to True.

(True/False)
4.8/5
(34)
Showing 21 - 40 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)