Exam 5: Repetition Structures

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

The integrity of a program's output is only as good as the integrity of its input. for this reason the program should discard input that is invalid and prompt the user to enter correct data.

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

True

The while loop is known as a(n) _______________ loop because it tests conditions before performing an iteration.

Free
(Short Answer)
4.9/5
(33)
Correct Answer:
Verified

pretest

In Python, an infinite loop usually occurs when the computer accesses the wrong memory address.

Free
(True/False)
4.9/5
(34)
Correct Answer:
Verified

False

A(n) _______________ is a special value that marks the end of a sequence of items.

(Short Answer)
4.9/5
(37)

What are the values that the variable num contains through the iterations of the following for loop? for num in range(4)

(Multiple Choice)
4.9/5
(40)

What is the structure that causes a statement or a set of statements to execute repeatedly?

(Multiple Choice)
4.9/5
(33)

When will the following loop terminate? while keep_on_going != 999 :

(Multiple Choice)
4.9/5
(34)

Which of the following represents an example to calculate the sum of the numbers (accumulator)?

(Multiple Choice)
4.8/5
(43)

The _______________ function is a built-in function that generates a list of integer values.

(Short Answer)
4.7/5
(40)

To get the total number of iterations of a nested loop, multiply the number of iterations of all the loops.

(True/False)
4.9/5
(45)

In Python, a comma-separated sequence of data items that are enclosed in a set of brackets is called a _____.

(Multiple Choice)
4.9/5
(31)

In Python, the variable in the for clause is referred to as the _____ because it is the target of an assignment at the beginning of each loop iteration.

(Multiple Choice)
4.9/5
(36)

In Python, you would use the _______________ statement to write a count-controlled loop.

(Short Answer)
4.9/5
(42)

In a nested loop, the inner loop goes through all of its iterations for every single iteration of an outer loop.

(True/False)
4.9/5
(36)

A(n) _______________-controlled loop causes a statement or set of statements to repeat as long as a condition ist.

(Short Answer)
4.8/5
(31)

Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1,5):

(True/False)
4.9/5
(31)

A(n) _______________ structure causes a statement or set of statements to execute repeatedly.

(Short Answer)
4.8/5
(45)

In flowcharting, the decision structure and the repetition structure both use the diamond symbol to represent the condition that is tested.

(True/False)
4.9/5
(31)

What type of loop structure repeats the code a specific number of times?

(Multiple Choice)
4.8/5
(37)

What is the format for the while clause in Python?

(Multiple Choice)
4.7/5
(41)
Showing 1 - 20 of 35
close modal

Filters

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