Chapter 4 Flashcards
instance
a member of a set. the TurtleWorld in this chapter is a member of the set of TurtleWorlds.
loop
a part of a program that can execute repeatedly.
encapsulation
the process of transforming a sequence of statements into a function definition.
generalization
the process of replacing something unnecessarily specific (like a number) with something appropriately general (like a variable or parameter)
keyword argument
an argument that includes the name of the parameter as a “keyword”.
interface
a description of how to use a function, including the name and descriptions of the arguments and return value.
refactoring
the process of modifying a working program to improve function interfaces and other qualities of the code.
development plan
a process for writing programs.
docstring
a string that appears in a function definition to document the function’s interface.
precondition
a requirement that should be satisfied by the caller before a function starts.
postcondition
a requirement that should be satisfied by the function before it ends.