Filters
Question type

Study Flashcards

"A"

A) True
B) False

Correct Answer

verifed

verified

Loop statements allow a computer to make choices.

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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


A) protracted assignment operators
B) augmented assignment operators
C) extended arithmetic operators
D) overloaded mathematic operators

E) All of the above
F) B) and D)

Correct Answer

verifed

verified

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


A) True
B) False
C) Undefined
D) TypeError

E) A) and D)
F) None of the above

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

True

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


A) A sentinel value is a user-provided input value that proceeds to the next loop.
B) A sentinel value is a user-provided input value that changes the structure of the loop.
C) A sentinel value is a special value provided by the user to terminate the loop.
D) A sentinel value is a special value provided by the user to restart the loop.

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

What is a count controlled loop?


A) It is a loop that counts iterations until a sentinel value is received.
B) It is a loop that continues based on a certain time interval.
C) It is a loop that prints out a count of values for the user.
D) It is a loop that counts through a range of numbers to control when the loop ends.

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

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?


A) exit
B) break
C) quit
D) halt

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

B

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

A) True
B) False

Correct Answer

verifed

verified

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


A) logic error
B) syntax error
C) type error
D) input error

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

True

In programming, what is a prototype?


A) It is a rough draft of a program.
B) It is a program in final stages of development.
C) It is a program statement that builds a module.
D) It is a production-ready program.

E) None of the above
F) A) and C)

Correct Answer

verifed

verified

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


A) Undefined
B) True
C) False
D) BooleanError

E) C) and D)
F) A) and D)

Correct Answer

verifed

verified

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


A) The third argument is used as the starting point for the range function.
B) The third argument specifies a step value to be used in the range.
C) The third argument declares an exponential value the numbers will be raised to.
D) The third argument is simply included in the sequence, assuming it wasn't already in the range.

E) All of the above
F) B) and C)

Correct Answer

verifed

verified

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


A) one space
B) two spaces
C) three spaces
D) four spaces

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer