Exam 3: Loops and Selection Statements

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

A condition expresses a hypothesis about the state of its world at that point in time.

Free
(True/False)
4.8/5
(33)
Correct Answer:
Verified

True

Inside of a loop, after a termination condition has been met, what statement can be used to cause an exit from the loop and execute the remainder of the script?

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

B

A while loop can be used for a count-controlled loop.

Free
(True/False)
4.7/5
(38)
Correct Answer:
Verified

True

In Python, = means equals, whereas == means assignment.

(True/False)
4.9/5
(31)

Simple Boolean expressions consist of the Boolean values True or False, variables bound to those values, function calls that return Boolean values, or comparisons.

(True/False)
4.8/5
(37)

Assuming that the value of x is 4, and the value of y is 6, what is the value of the following expression? (x - y)**2 > y

(Multiple Choice)
4.7/5
(40)

When using the range function, what effect does the specification of a third argument have?

(Multiple Choice)
4.7/5
(35)

An off-by-one error is an example of what type of error in programming?

(Multiple Choice)
4.7/5
(38)

The or operator returns True if and only if both of its operands are true, and returns False otherwise.

(True/False)
4.9/5
(30)

In a conditional iteration loop, such as a while loop, what is a sentinel value?

(Multiple Choice)
4.8/5
(40)

The augmented assignment operations have a higher precedence than the standard assignment operation.

(True/False)
4.8/5
(36)

The use of +=, -=, and *= are all examples of what type of operators?

(Multiple Choice)
4.9/5
(38)

Loop statements allow a computer to make choices.

(True/False)
4.9/5
(43)

The if-else statement is the most common type of selection statement.

(True/False)
4.8/5
(43)

If A is True, what will the statement "not A" return?

(Multiple Choice)
4.8/5
(48)

"A"

(True/False)
4.7/5
(39)

What is the minimum number of spaces that should be used to create an indented statement?

(Multiple Choice)
4.7/5
(43)

For the most part, off-by-one errors result when the programmer incorrectly specifies the lower bound of the loop.

(True/False)
4.9/5
(37)

In programming, what is a prototype?

(Multiple Choice)
4.9/5
(39)

What is a count controlled loop?

(Multiple Choice)
5.0/5
(35)
Showing 1 - 20 of 50
close modal

Filters

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