Chapter 7 Iteration

Description

AS - Level Computer Science (CS 1101 Python) Flashcards on Chapter 7 Iteration, created by Troy Bowlin on 19/05/2016.
Troy Bowlin
Flashcards by Troy Bowlin, updated more than 1 year ago
Troy Bowlin
Created by Troy Bowlin almost 8 years ago
12
0

Resource summary

Question Answer
Algorithm A step by step process for solving a category of problems
Body The statements inside a loop
Breakpoint A place in your program code where program execution will pause, allowing you to inspect the state of the program's variables, or single step through individual statements, executing them one at a time
Bump Programming slang. Synonym for increment
Continue Statement A statement that causes the remainder of the current iteration of a loop to be skipped. The flow of execution goes back to the top of the loop, evaluates the condition, and if this is true the next iteration of the loop will begin.
Counter A variable used to count something, usually initialized to zero and incremented in the body of a loop
Curser An invisible marker that keeps track of where the next character will be printed
Decrement Decrease by 1
Definite Iteration A loop where we have an upper bound on the number of times the body will be executed. Definite iteration is usually best coded as a for loop.
Development Plan A process for developing a program. In this chapter, we demonstrated a style of development based on developing code to do simple, specific things and then encapsulating and generalizing.
Encapsulate To divide a large complex program into components (like functions) and isolate the components from each other (by using local variable, for example)
Escape Sequence An escape character, \, followed by one or more printable characters used to designate a non printable character.
Generalize To replace something unnecessarily specific (like a constant value) with something appropriately general (like a variable or parameter). Generalization makes code more versatile, more likely to be reused, and sometimes even easier to write.
Increment Both as a noun and as a verb, increment means to increase by 1.
Infinite Loop A loop in which the terminating condition is never satisified
Indefinite Iteration A loop where we just need to keep going until some condition is met. A while statement is used for this case.
Initialization (of a variable) To initialize a variable is to give it an initial value. Since in Python variables don't exist until they are assigned values, they are initialized when they are created. In other programming languages this is not the case, and variables can be created without being initialized, in which case they have either default or garbage values.
Iteration Repeated execution of a set of programming statements.
Loop The construct that allows us to repeatedly execute a statement or a group of statements until a terminating condition is satisfied.
Loop variable A variable used as part of the terminating condition of a loop.
Meta-notation Extra symbols or notation that helps describe other notation. Here we introduced square brackets, ellipses, italics, and bold as meta-notation to help describe optional, repeatable, substitutable and fixed parts of the Python syntax.
Middle-test Loop Extra symbols or notation that helps describe other notation. Here we introduced square brackets, ellipses, italics, and bold as meta-notation to help describe optional, repeatable, substitutable and fixed parts of the Python syntax.
Nested Loop A loop inside the body of another loop
Newline A special character that causes the cursor to move to the beginning of the next line
Post-test Loop A loop that executes the body, then tests for the exit condition. We don't have a special Python construct for this, but can use while and break together.
Pre-Test Loop A loop that tests before deciding whether to execute its body. for and while are both pre-test loops.
Single-Step A mode for interpreter execution where you are able to execute your program one step at a time, and inspect the consequences of that step. Useful for debugging and building your internal mental model of what is going on.
Tab A special character that causes the cursor to move to the next tab stop on the current line.
Trichotomy Given any real numbers a and b, exactly one of the following relations hold: a<b, a>b, or a==b. Thus when you can establish that two of the relations are false, you can assume the remaining one is true.
Trace To follow the flow of execution of a program by hand, recording the change of state of the variables and any output produced.
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr