Chapter 7 Flashcards

1
Q

algorithm

A

A step-by-step process for solving a category of problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

body

A

The statements inside a loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

breakpoint

A

A place in your program code where program execution will pause (or break), allowing you to inspect the state of the program’s variables, or single-step through individual statements, executing them one at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

bump

A

Programmer slang. Synonym for increment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

continue statement

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

counter

A

A variable used to count something, usually initialized to zero and incremented in the body of a loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

cursor

A

An invisible marker that keeps track of where the next character will be printed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

decrement

A

Decrease by 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

definite iteration

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

development plan

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

encapsulate

A

To divide a large complex program into components (like functions) and isolate the components from each other (by using local variables, for example).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

escape sequence

A

An escape character, \, followed by one or more printable characters used to designate a nonprintable character.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

generalize

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

increment

A

Both as a noun and as a verb, increment means to increase by 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

infinite loop

A

A loop in which the terminating condition is never satisfied.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

indefinite iteration

A

A loop where we just need to keep going until some condition is met. A while statement is used for this case.

17
Q

initialization

A

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.

18
Q

iteration

A

Repeated execution of a set of programming statements.

19
Q

loop

A

The construct that allows allows us to repeatedly execute a statement or a group of statements until a terminating condition is satisfied.

20
Q

loop variable

A

A variable used as part of the terminating condition of a loop.

21
Q

meta-notation

A

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.

22
Q

middle-test loop

A

A loop that executes some of the body, then tests for the exit condition, and then may execute some more of the body. We don’t have a special Python construct for this case, but can use while and break together.

23
Q

nested loop

A

A loop inside the body of another loop.

24
Q

newline

A

A special character that causes the cursor to move to the beginning of the next line.

25
Q

post-test loop

A

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.

26
Q

pre-test loop

A

A loop that tests before deciding whether the execute its body. for and while are both pre-test loops.

27
Q

single-step

A

A mode of 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.

28
Q

tab

A

A special character that causes the cursor to move to the next tab stop on the current line.

29
Q

trichotomy

A

Given any real numbers a and b, exactly one of the following relations holds: 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.

30
Q

trace

A

To follow the flow of execution of a program by hand, recording the change of state of the variables and any output produced.