Chapter 4 - Definitions Flashcards
Define attribute
Some state or value that belongs to a particular object. For example, tess has a colour.
Define canvas
A surface within a window where drawing takes place
Define control flow
See “flow of execution” in the next chapter
Define for loop
A statement in Python for convenient repetition of statements in the body of the loop
Define instance
An object that belongs to a class. tess and alex are different instances of the class Turtle
Define invoke
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.
Define iteration
A basic building block for algorithms ( programs). It allows steps to be repeated. Sometimes called looping.
Define loop body
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
Define method
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)
Define module
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.
Define object
The “thing” to which a variable can refer. This can be a screen window, or one of the turtles you have created.
Define range
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.
Define sequential
The default behaviour of a program. Step by step processing of algorithm.
Define state
The collection of attribute values that a specific data object maintains
Define terminating condition
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