CIS 115 Quiz 3

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

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

0, 1, 2, 3

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

2, 4, 6, 8

What is not an example of an augmented assignment operator?

<=

The variable used to keep the running total is called a(n)______.

Accumulator

What type of loop structure repeats the code based on the value of the Boolean expression?

Condition-controlled loop

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

Count-controlled loop

True/False: In Python, an infinite loop usually occurs when the computer accesses the wrong memory address

False

True/False: The first line in the while loop is referred to as the condition clause

False

What is the disadvantage of coding in one long sequence structure?

If parts of the duplicated code have to be corrected, the correction has to be made many times

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

Input validation

True/False: A better 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 the statements as many times as necessary

True

True/False: 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

True/False: Reducing duplication of code is one of the advantages of using a loop structure

True

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

When keep_on_going refers to a value equal to 999

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

total += number

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

List

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

Priming read

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

Repetition

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

Target variable

What is the format for the while clause in Python?

While condition:


Ensembles d'études connexes

Real Estate Practice Exam Questions

View Set

Business CH.12: Dealing with Union & Employee- Management Issues

View Set

PrepU Passpoint Basic Physical Care

View Set

Chap 71 Mass Casualty and Disaster Preparedness

View Set

Lesson 117 - Lighting and Small Appliance Branch Circuits Homework

View Set