Programming - Chapter 3 & 4

studied byStudied by 4 people
4.0(1)
get a hint
hint

Attribute

1 / 59

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

60 Terms

1

Attribute

Some state or value that belongs to a particular object.

New cards
2

Canvas

Surface within window where drawing takes place.

New cards
3

Control Flow

???

New cards
4

For Loop

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

New cards
5

Loop Body

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

New cards
6

Loop Variable

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

New cards
7

Instance

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

New cards
8

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)).

New cards
9

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)

New cards
10

Module

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

New cards
11

Object

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

New cards
12

Range

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

New cards
13

Terminating Condition

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

New cards
14

Block

Group of consecutive statements with the same indentation.

New cards
15

Body

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

New cards
16

Boolean algebra

Rules for rearranging/reasoning abt Boolean expressions.

New cards
17

Boolean expression

Expression that is either true or false.

New cards
18

Boolean value

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

New cards
19

Branch

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

New cards
20

Chained conditional

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

New cards
21

Comparison Operator

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

New cards
22

Condition

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

New cards
23

Conditional Statement

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

New cards
24

Logical operator

Operator combining Booleans: and, or, not.

New cards
25

Nesting

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

New cards
26

Prompt

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

New cards
27

Truth table

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

New cards
28

Type Conversion

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

New cards
29

Algorithm

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

New cards
30

Body

Statements inside a loop.

New cards
31

Bump

Slang for increment

New cards
32

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.

New cards
33

Counter

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

New cards
34

Cursor

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

New cards
35

Decrement

Decrease by 1

New cards
36

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.

New cards
37

Escape Sequence

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

New cards
38

Increment

Increase by 1.

New cards
39

Infinite loop

Loop where terminating condition is never satisfied so never ends.

New cards
40

Indefinite Iteration

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

New cards
41

Initialization

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

New cards
42

Iteration

Repeated execution of a set of programming statements.

New cards
43

Loop

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

New cards
44

Loop Variable

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

New cards
45

Meta-Notation

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

New cards
46

Middle-Test Loop

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

New cards
47

Pre-Test Loop

Loop that tests before deciding whether to execute its body.

New cards
48

Tab

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

New cards
49

Trichotomy

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

New cards
50

Trace

Follow flow of execution of a program by hand.

New cards
51

Boolean Function

Function returning a Boolean value. True or False.

New cards
52

Chatterbox Function

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

New cards
53

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.

New cards
54

Dead Code

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

New cards
55

Fruitful Function

Function that yields a return value instead of none

New cards
56

Incremental development

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

New cards
57

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.

New cards
58

Return value

Value provided as the result of a function call

New cards
59

Scaffolding

Code used during development used to help debugging and development.

New cards
60

Temporary Variable

Variable used to store intermediate value in complex calculation

New cards

Explore top notes

note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 16 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 25 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 8 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 15 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 5 people
Updated ... ago
4.0 Stars(1)
note Note
studied byStudied by 7884 people
Updated ... ago
4.8 Stars(38)

Explore top flashcards

flashcards Flashcard30 terms
studied byStudied by 11 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard26 terms
studied byStudied by 1067 people
Updated ... ago
4.5 Stars(2)
flashcards Flashcard40 terms
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard187 terms
studied byStudied by 22 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard22 terms
studied byStudied by 68 people
Updated ... ago
5.0 Stars(4)
flashcards Flashcard58 terms
studied byStudied by 9 people
Updated ... ago
5.0 Stars(2)
flashcards Flashcard71 terms
studied byStudied by 14 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard25 terms
studied byStudied by 247 people
Updated ... ago
5.0 Stars(4)