1/34
Looks like no tags are added yet.
Iterable
An object that is similar to a list. It contains a sequence of values that can be iterated over with something like a loop
Target Variable
The target of an assignment at the beginning of each loop iteration
Initialization, Comparison, Update
The three actions that your code must perform in order to write a count-controlled while loop
Initialization
The counter variable must be initialized to a suitable starting value before the loop begins
Comparison
The loop must compare the counter variable to a suitable ending value, to determine whether the loop should iterate or not
Update
During each iteration, the loop must update the counter variable with a new value
Counter Variable
A variable that is assigned a unique value during each iteration of a loop
Infinite Loop
If a loop does not have a way of stopping it is called an ___. They repeat until the program is interrupted
Pretest Loop
The while loop is known as a ___, which means it tests its condition before performing an iteration
Iteration
Each execution of the body of a loop
Count-Controlled Loop
Repeats a specific number of times
Condition-Controlled Loop
Uses a true/false condition to control the number of times that it repeats
Repetition Structure
Causes a statement or set of statements to execute repeatedly
False
To calculate the total number of iterations of a nested loop, add the number of iterations of all the loops
False
It is not necessary to initialize accumulator variables
True
In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop
True
The while loop is a pretest loop
Augmented Assignment
The -= operator is an example of a(n) operator
Accumulator
A(n) ___ variable keeps a running total
Sentinel
A(n) ___ is a special value that signals when there are no more items from a list of items to be processed. This value cannot be mistaken as an item from the list
Garbage In, Garbage Out
GIGO stands for ___
Input
The integrity of a program's output is only as good as the integrity of the program's ___
Priming Read
The input operation that appears just before a validation loop is known as the ___
Error Traps
Validation loops are also known as ___
Break
The ___ statement causes a loop to terminate early
Continue
The ___ statement causes a loop to stop its current iteration and begin the next one
Else
When the ___ clause is used with a loop in Python, it executes when the loop ends normally, without encountering a break statement
True
T/F: inner loops complete their iterations faster than outer loops
Multiply
To get the total number of iterations in a nested loop, ___ the number of iterations of all the loops
Input Validation
The process of inspecting data that has been input to a program, to make sure it is valid before it is used in a computation
Loop
A control structure that causes a statement or group of statements to repeat as many times as necessary is known as a(n) _____
Diamond
The symbol that represents the condition being tested
Starting Value
The first argument passed to the range function
Ending Limit
The second argument passed to the range function
Step Value
The third argument passed to the range function