Intro to Coding - Iteration

¡Supera tus tareas y exámenes ahora con Quizwiz!

What is used as a placeholder for future code and has no function being executed? a return statement a pass statement a hold statement an exit statement

2. a pass statement

Which of the following describes iteration in computer programming? a set of instructions that can be run one time only a set of instructions that can be run multiple times throughout a program a set of instructions for setting the end of a program a set of instructions used by a computer program to correct problems in the code

2. a set of instructions that can be run multiple times throughout a program

What would a programmer use to stop a while-looping sequence and return to the beginning of the statement? a break statement a final statement a continue statement an exit statement

3. a continue statement

A for-loop statement can iterate over many items in a function. a variable. a list. a pass statement.

3. a list

What is one pass of a coding sequence called? a return a loop an iteration an infinite loop

3. an iteration

Which type of statement is a pass statement that implies that nothing occurs when it is executed? redirect hold null infinite

3. null

Which of the following is used as a placeholder for future code and has no function being executed? hold return pass null

3. pass

What keyboard combination can a programmer issue to stop an infinite-loop statement? CTRL+S CTRL+N CTRL+T CTRL+C

4. CTRL+C

What is a smaller loop statement that can appear on the same line of code? an infinite statement a finite statement a repeat statement a single statement

4. a single statement

What stops the current loop and resumes execution at the next statement? the break statement the final statement the pass statement the infinite-loop statement

1. the break statement

Which of the following returns to the beginning of the while loop? the continue statement the break statement the return statement the end statement

1. the continute statement

A programmer can interrupt an infinite loop by pressing which keyboard combination? CTRL+C ESC ALT+S CTRL+S

1. CTRL+C

What does a loop statement do? It causes a section of code to be repeated a certain number of times. It causes a section of code to be executed one time only. It causes a section of code to end. It causes a section of code to be repeated infinitely.

1. It causes a section of code to be repeated a certain number of times.

Use the drop-down menus to complete these sentences. ? is one set of coding instructions processing many different sets of data and eliminating multiple lines of code. A loop ends when a condition becomes ? he loop repetition will continue for as long as the condition in the code remains ?

1. Iteration value 2.false 3. true

What is a while-loop statement? a Python construct that repeats until the expression becomes false a Python construct that repeats until the expression becomes true a Python construct that repeats infinitely a Python construct that repeats until the programmer issues code to stop it

1. a Python construct that repeats until the expression becomes false

What is a loop statement that never resolves to a false value? an infinite loop a continuous loop a single loop a statement loop

1. an infinite loop

Use the drop-down menus to complete these sentences. The ? statement stops the current loop and resumes execution at the next statement. The ? statement returns to the beginning of the loop. The ? statement is used as a placeholder for future code; nothing happens when it is executed.

1. break 2. continue 3. pass

Use the drop-down menus to complete these sentences. The running of a set of programming instructions multiple times is called ? If a sequence of code is repeated multiple times, it is referred to as ? One set of coding instructions processing many different sets of data and eliminating multiple lines of code is an example of ?

1. iteration 2. a loop 3. the value of iteration

Use the drop-down menus to complete the following sentences. The for loop can iterate over many items in a ? The for loop looks for the ? in the sequence and continues until the ? in the list is complete. The ? uses a built-in function called length, or len(), which provides the total number of elements in the ordered list of elements as well as the range.

1. list 2. first variable, last variable 3. sequence index

Use the drop-down menus to complete the sentences. A(n) ? statement causes a section of code to be repeated a certain number of times. The repetition in the loop will continue for as long as the condition remains ? The loop ends and the program continues to the next code block when the condition becomes ?

1. loop 2. true 3.false

What does a for loop look for in the sequence of data? Check all that apply. the first variable the second variable the third variable the last variable

1. the first variable 4. the last variable

What is the name of a coding sequence that is executed multiple times in a program? a continue a loop a pass a return

2. a loop


Conjuntos de estudio relacionados

Chapter 6 Quiz - Long-term Memory Structure

View Set

US History Chapter 26 Study Guide for test

View Set

BIO II Exam 1 Chapters 20-23 (Phylogeny, Virus, Prokaryote, and Protist)

View Set

AP Calculus A/B: Particle Motion

View Set