Ch 4 Turtle Graphics Flashcards
attribute
Some state or value that belongs to a particular object. For example, tess (the turtle) has a color
canvas
A surface within a window where drawing takes place. Where turtles can roam free.
control flow
Loops, branches, and function calls. Loops = for and while loops. Branches = if, elif, else. Functions = ahem… functions
for loop
A statement in Python for convenient repetition of statements in the body of the loop
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.
instance
An object that belongs to a class. tess and alex (the Turtles) are different instances of the class Turtle.
iteration
A basic building block for algorithms (programs). It allows steps to be repeated. Sometimes called looping.
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.
loop variable
A variable used as part of a for loop. It is assigned a different value on each iteration of the loop, and is used as part of the terminating condition of the loop, when it can no longer get a further value.
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)”
object
A “thing” to which a variable can refer. This could be a screen window, or one of the turtles you have created.
range
A built-in function in Python for generating sequences of integers. It is especially useful when we need to write a for loop that executes a fixed number of times.
sequential
The default behavior of a program. Step by step processing of an algorithm.
terminating condition
A condition that occurs which causes a loop to stop repeating its body. break, continue, else, pass
turtle
A data object used to create pictures (known as turtle graphics)