14. Glossary
- attribute
- Some state or value that belongs to a particular object. For example,
tess
has a color.
- canvas
- A surface within a window, or
Screen
, where drawing takes place.
- deterministic
- A process that is repeatable and predictable.
- documentation
- A place where you can go to get detailed information about aspects of a programming language.
- for loop
- A construct in Python for convenient repetition of statements in the body of the loop.
- import
- The
import
statement is used to gain access to the code (e.g., classes and functions) contained in another module. It searches for the named module and binds the results of that search to a name in the current program (the one that is requesting the import).
- instance
- An object that belongs to a class. E.g.,
tess
and alex
are different instances of the class `Turtle
.
- 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.
- iteration
- Repeated execution of a set of programming statements. Sometimes called looping or repetition.
- loop
- A statement or group of statements that execute repeatedly until a terminating condition is satisfied.
- 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 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.
- 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)
.
- 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.
- object
- A “thing” to which a variable can refer. This could be a screen window, or one of the turtles you have created.
- pseudo-random number
- A number that is not genuinely random but is instead created algorithmically.
- random number
- A number that is generated in such a way as to exhibit statistical randomness.
- random number generator
- A function that will provide you with random numbers, usually between 0 and 1.
- range
- A built-in type in Python that is especially useful when we need to write a
for
loop.
- sequential
- The default behavior of a program. Step by step processing of algorithm.
- standard library
- A collection of modules that are part of the normal installation of Python.
- state
- 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
for
loops we saw in this chapter, the terminating condition has been when there are no more elements to assign to the loop variable.
- turtle
- A data object used to create pictures (known as turtle graphics).