Before you keep reading...
Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.
Before you keep reading...
Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.
Some state or value that belongs to a particular object. For example, tess has a color.
A surface within a window where drawing takes place.
- control flow¶
See flow of execution in the next chapter.
- for loop¶
A statement in Python for convenient repetition of statements in the body of the loop.
An object that belongs to a class. tess and alex are different instances of the class Turtle
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
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.
A function that is attached to an object. Invoking or activating the method causes the object to respond in some way, e.g.
forwardis the method when we say
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.
A “thing” to which a variable can refer. This could be a screen window, or one of the turtles you have created.
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.
The default behavior of a program. Step by step processing of algorithm.
The collection of attribute values that a specific data object maintains.
- terminating condition¶
A condition that occurs which causes a loop to stop repeating its body. In the
forloops we saw in this chapter, the terminating condition has been when there are no more elements to assign to the loop variable.
A data object used to create pictures (known as turtle graphics).