Filters
Question type

Study Flashcards

What is a one-way selection statement in the context of Python?


A) It is a single if statement without a corresponding else statement used to test a condition and run statements, then proceed to the next statement.
B) It is a single if-else statement block that is used to test a condition and run statements, as well as provide a default path for execution.
C) It is a switch statement block that is used to direct the flow of data based on a single condition.
D) It is an if statement that tests no conditions, but provides a block for execution.

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

Correct Answer

verifed

verified

What are the two different types of loops that are used within the Python language? (Choose two.)


A) predetermined looping
B) definite iteration
C) infinite cycling
D) indefinite iteration

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

Correct Answer

verifed

verified

In general terms, what does a selection statement do?


A) It forces a computer to favor one value over another.
B) It allows a computer to make choices based on test conditions.
C) It allows a computer to select the values that are most economical.
D) It allows a computer to selectively execute based on processing cost.

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

Correct Answer

verifed

verified

There are two types of loops-those that repeat an action a predefined number of times (definite iteration) and those that perform the action until the program determines that it needs to stop (indefinite iteration).

A) True
B) False

Correct Answer

verifed

verified

In evaluating a loop, you find the following statement: "value += 1". What happens to the value variable upon each iteration of the loop?


A) The variable is reset to an int type, with a value of 1.
B) The variable's value is changed to a positive value.
C) The variable is increased by 1 each iteration through the loop.
D) The variable is incremented by itself.

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

Correct Answer

verifed

verified

The statements within a while loop can execute one or more times.

A) True
B) False

Correct Answer

verifed

verified

What character is used as the format operator when formatting output?


A) ^
B) $
C) %
D) @

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

Correct Answer

verifed

verified

The while loop is also known as what kind of a loop?


A) infinite loop
B) operational loop
C) user-control loop
D) entry-control loop

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

Correct Answer

verifed

verified

The while loop is also called a sentinel-control loop, because its condition is tested at the top of the loop.

A) True
B) False

Correct Answer

verifed

verified

The statements in the loop body need not be indented and aligned in the same column.

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer