MIS 304 Lecture Notes - Lecture 8: Augmented Assignment
Document Summary
Places code in a structure that makes the computer repeat it as many times as necessary. Uses a true/false condition to control the number of times it repeats. Statement or set of statements repeated as long as condition is true. Iteration: each execution of the body of a loop. Pretest loop: tests its condition before performing an iteration. Infinite loop: continues to repeat until the program is interrupted. General format for variable in [value1, value2, value3]: Target of an assignment at the beginning of each loop iteration. List: a comma-separated sequence of data items that are enclosed in a set of brackets. Range function: simplifies writing a count-controlled for loop by creating an iterable. Contains a sequence of values that can be iterated over with something like a loop for variable in range(iterable) Generates iterable sequence of integers up to but not including the number. Variable that is used to accumulate total of numbers.