Filters
Question type

Study Flashcards

A good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a loop that will repeat as many times as necessary.

A) True
B) False

Correct Answer

verifed

verified

The acronym __________ refers to the fact that the computer cannot tell the difference between good data and bad data.

Correct Answer

verifed

verified

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


A) condition-controlled loop
B) number-controlled loop
C) count-controlled loop
D) Boolean-controlled loop

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

What will be displayed after the following code is executed? total =0 =0 for count in range (1,4) : (1,4) : \quad total += += count print (total)


A) 1
3
6
B) 5
C) 1 4
D) 6

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

Correct Answer

verifed

verified

A(n)__________-controlled loop causes a statement or set of statements to repeat as long as the condition is true.

Correct Answer

verifed

verified

The while loop is known as a(n)__________ loop because it tests the condition before performing an iteration.

Correct Answer

verifed

verified

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


A) sequence
B) decision
C) module
D) repetition

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

Correct Answer

verifed

verified

__________ is the process of inspecting data that has been input into a program in order to ensure that the data is valid before it is used in a computation.


A) Input validation
B) Correcting data
C) Data validation
D) Correcting input

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

Correct Answer

verifed

verified

A(n)___________ structure causes a set of statements to execute repeatedly.

Correct Answer

verifed

verified

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


A) 1, 2, 3, 4
B) 0, 1, 2, 3, 4
C) 1, 2, 3
D) 0, 1, 2, 3

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

Correct Answer

verifed

verified

What will be displayed after the following code is executed? What will be displayed after the following code is executed?   A)  30 B)  25 C)  0 5 10 15 20 D)  5 10 15


A) 30
B) 25
C) 0 5 10 15 20
D) 5 10 15

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

Correct Answer

verifed

verified

Which of the following is not an augmented assignment operator?


A) *=
B) /=
C) +=
D) <=

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

Correct Answer

verifed

verified

Reducing duplication of code is one of the advantages of using a loop structure.

A) True
B) False

Correct Answer

verifed

verified

The first line in a while loop is referred to as the condition clause.

A) True
B) False

Correct Answer

verifed

verified

The first operation is called the __________ and its purpose is to get the first input value that will be tested by the validation loop.


A) priming read
B) first input
C) loop set read
D) loop validation

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

Correct Answer

verifed

verified

In order to draw an octagon with turtle graphics,you would need a loop that iterates eight times.

A) True
B) False

Correct Answer

verifed

verified

A(n)___________ loop usually occurs when the programmer does not include code inside the loop that makes the test condition false.

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Showing 21 - 40 of 41

Related Exams

Show Answer