Chapter 4 - Definitions Flashcards

1
Q

Define attribute

A

Some state or value that belongs to a particular object. For example, tess has a colour.

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

Define canvas

A

A surface within a window where drawing takes place

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

Define control flow

A

See “flow of execution” in the next chapter

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

Define for loop

A

A statement in Python for convenient repetition of statements in the body of the loop

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

Define instance

A

An object that belongs to a class. tess and alex are different instances of the class Turtle

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

Define invoke

A

An object has methods. We use the verb invoke to mean activate the method. Invoking a method is done by putting parentheses after the method name, with some possible arguments. So wn.exitonclick() is an invocation of the exitonclick method.

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

Define iteration

A

A basic building block for algorithms ( programs). It allows steps to be repeated. Sometimes called looping.

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

Define loop body

A

Any number of statements nested inside a loop. The nesting is indicated by the fact that the statements are indented under the for loop statement

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

Define method

A

A function that is attached to an object. Invoking or activating the method causes the object to respond in some way, e.g. forward is the method when we say tess.forward(100)

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

Define module

A

A file containing Python definitions and statements intended for use in other Python programs. The contents of a module are made available to the other program by using the import statement.

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

Define object

A

The “thing” to which a variable can refer. This can be a screen window, or one of the turtles you have created.

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

Define range

A

A built-in function in Python for generating sequence of integers. It is especially useful when we need to write a loop that executes a fixed number of times.

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

Define sequential

A

The default behaviour of a program. Step by step processing of algorithm.

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

Define state

A

The collection of attribute values that a specific data object maintains

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

Define terminating condition

A

A condition that occurs which causes a loop to stop repeating its body. In the for loops we saw in this chapter, the terminating condition has been when there are no elements to assign to the loop variable

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

Define turtle

A

A data object used to create pictures (known as turtle graphics)