Programming - Chapter 3 & 4

4.0(1)
studied byStudied by 4 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/59

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

60 Terms

1
New cards

Attribute

Some state or value that belongs to a particular object.

2
New cards

Canvas

Surface within window where drawing takes place.

3
New cards

Control Flow

???

4
New cards

For Loop

Statement in python for convient repetition of statements in the body of the loop.

5
New cards

Loop Body

Any number of statements that are nested in the loop. Nesting is indicated by indentation under the loop statement.

6
New cards

Loop Variable

Variable used as part of a for loop. Assigned a different value each iteration of the loop.

7
New cards

Instance

Object of certain type/class . Ex. alex is a different instance of the class turtle.

8
New cards

Method

Function that is attached to an object. Invoking/activating the method makes the object to respond. (Ex. forward is the method when we say turtle.forward(100)).

9
New cards

Invoke

Invoke means to activate the method. Done by putting () after method name with arguments. (Ex. turtle.forward() is the invocation of the forward method)

10
New cards

Module

File containing Python definitions/statements make for use in other programs. Only avaliable after using import statement.

11
New cards

Object

Something to which a varialbe can refer to (screen window, a turtle, etc.)

12
New cards

Range

Built-in function in python for generating sequences of integers. Useful when we write a loop executing a fixed number of times.

13
New cards

Terminating Condition

Condition which causes a loop to stop repeating its body. When there are no more elements to assign to the loop variable.

14
New cards

Block

Group of consecutive statements with the same indentation.

15
New cards

Body

Block of statements in a compound statement following the header.?????

16
New cards

Boolean algebra

Rules for rearranging/reasoning abt Boolean expressions.

17
New cards

Boolean expression

Expression that is either true or false.

18
New cards

Boolean value

True and False. Values result when expression is evaluated by the interpreter.

19
New cards

Branch

One of the possible paths of the flow of execution determined by conditional execution.

20
New cards

Chained conditional

Conditional branch with more than two possible flows of execution. Written with if…elif…else…statements.

21
New cards

Comparison Operator

==, ≠, >, <, >=, and <=. Used to compare 2 values

22
New cards

Condition

Boolean expression in a conditional statement determining which branch is executed.

23
New cards

Conditional Statement

Statement controlling flow of execution depending on some condition. if, elif, else.

24
New cards

Logical operator

Operator combining Booleans: and, or, not.

25
New cards

Nesting

One program structure within another, like conditional statement inside a branch of another conditional statement.

26
New cards

Prompt

Visual cue telling user that the system is ready to accept input. The flashing thingy.

27
New cards

Truth table

Concise table of Boolean values that can describe semantics of an operator.

28
New cards

Type Conversion

Explicit function taking the value of one type and computing corresponding value of another type.

29
New cards

Algorithm

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

30
New cards

Body

Statements inside a loop.

31
New cards

Bump

Slang for increment

32
New cards

Continue statement

Statement causing remainder of current iteration of a loop to be skipped. Flow of execution goes back to top of loop, evaluates condition, and if true, next iteration will begin.

33
New cards

Counter

Variable used to count smth, usually incremented with a loop.

34
New cards

Cursor

Invisible marker keeping track of where the next character is printed.

35
New cards

Decrement

Decrease by 1

36
New cards

Definite Iteration

Loop where there is an upper bound on the number of times the body will be executed. Usually best coded as a for loop.

37
New cards

Escape Sequence

Escape character, \, followed by printable characters to designate a nonprintable character.

38
New cards

Increment

Increase by 1.

39
New cards

Infinite loop

Loop where terminating condition is never satisfied so never ends.

40
New cards

Indefinite Iteration

Loop where we just need to keep going until a condition is met. While statement is used.

41
New cards

Initialization

Gives variable an initial value so it can be used later.

42
New cards

Iteration

Repeated execution of a set of programming statements.

43
New cards

Loop

Construct allowing us to repeatedly execute a statement or group of statements until a terminating condition is satisfied.

44
New cards

Loop Variable

Variable used as part of the terminating condition of a loop.

45
New cards

Meta-Notation

Extra symbols/notation helping describe other notation. [], …, italics, bold, etc. to describe python syntax.

46
New cards

Middle-Test Loop

Loop executing some of the body then testing exit condition and can execute some more of the body. While and break.

47
New cards

Pre-Test Loop

Loop that tests before deciding whether to execute its body.

48
New cards

Tab

Causes cursor to move to the next tab stop on current line.

49
New cards

Trichotomy

Seeing which expressions numbers make true: a<b, a>b, a==b.

50
New cards

Trace

Follow flow of execution of a program by hand.

51
New cards

Boolean Function

Function returning a Boolean value. True or False.

52
New cards

Chatterbox Function

Function interacting with the user (print or input) when it shouldn’t. Silent functions converting input arguments into outputs are better.

53
New cards

Composition

Calling one function from within the body of another or using return value of one function as an argument to the call of another.

54
New cards

Dead Code

Part of the program can never be executed, often because it appears after a return statement

55
New cards

Fruitful Function

Function that yields a return value instead of none

56
New cards

Incremental development

Program development plan intended to simplify debugging by adding and testing only a small amt of code at a time.

57
New cards

None

Special python value. One use in python is that it is returned by functions that do not execute a return statement with a return argument.

58
New cards

Return value

Value provided as the result of a function call

59
New cards

Scaffolding

Code used during development used to help debugging and development.

60
New cards

Temporary Variable

Variable used to store intermediate value in complex calculation