Glossary Flashcards
algorithm
A general, mechanical process for solving a category of problems.
bug
An error in a program.
byte code
An intermediate language between source code and object code. Many modern languages first compile source code into byte code and then interpret the byte code with a program called a virtual machine.
compile
To translate a program written in a high-level language into a low-level language all at once, in preparation for later execution.
debugging
The process of finding and removing any of the three kinds of programming errors.
executable
Another name for object code that is ready to be executed.
formal language
languages designed for specific purposes, such as representing mathematical ideas or computer programs; all programming languages are formal languages.
high-level language
A programming language like Python that is designed to be easy for humans to read and write.
interpret
To execute a program in a high-level language by translating it one line at a time.
low-level language
A programming language that is designed to be easy for a computer to execute; also called machine language or assembly language.
natural language
Any one of the languages that people speak that evolved naturally.
object code
The output of the compiler after it translates the program.
parse
To examine a program and analyze the syntactic structure.
portability
A property of a program that can run on more than one kind of computer.
print statement
An instruction that causes the Python interpreter to display a value on the screen.
problem solving
The process of formulating a problem, finding a solution, and expressing the solution.
program
a sequence of instructions that specifies to a computer actions and computations to be performed.
Python shell
An interactive user interface to the Python interpreter. The user of a Python shell types commands at the prompt (»>), and presses the return key to send these commands immediately to the interpreter for processing.
runtime error
An error that does not occur until the program has started to execute but that prevents the program from continuing.
script
A program stored in a file (usually one that will be interpreted).
semantic error
An error in a program that makes it do something other than what the programmer intended.
semantics
The meaning of a program.
source code
A program in a high-level language before being compiled.
syntax
The structure of a program.
syntax error
An error in a program that makes it impossible to parse — and therefore impossible to interpret.
token
One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.
assignment operator
= is Python’s assignment operator, which should not be confused with the mathematical comparison operator using the same symbol.
assignment statement
A statement that assigns a value to a name (variable). To the left of the assignment operator, =, is a name. To the right of the assignment operator is an expression
comment
Information in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program.
composition
The ability to combine simple expressions and statements into compound statements and expressions in order to represent complex computations concisely. Also refers to building functions by calling other functions
composition
The ability to combine simple expressions and statements into compound statements and expressions in order to represent complex computations concisely.
concatenate
To join two strings end-to-end.
data type
A set of values. The type of a value determines how it can be used in expressions. So far, the types you have seen are integers (type int), floating-point numbers (type float), and strings (type str).
evaluate
To simplify an expression by performing the operations in order to yield a single value.
expression
A combination of variables, operators, and values that represents a single result value.
float
A Python data type which stores floating-point numbers. Floating-point numbers are stored internally in two parts: a base and an exponent. When printed in the standard format, they look like decimal numbers. Beware of rounding errors when you use floats, and remember that they are only approximate values.
int
A Python data type that holds positive and negative whole numbers.
integer division
An operation that divides one integer by another and yields an integer. Integer division yields only the whole number of times that the numerator is divisible by the denominator and discards any remainder.
keyword
A reserved word that is used by the compiler to parse program; you cannot use keywords like if, def, and while as variable names.
operand
One of the values on which an operator operates.
operator
A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
rules of precedence
The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.
state diagram
A graphical representation of a set of variables and the values to which they refer.
statement
An instruction that the Python interpreter can execute. Examples of statements include the assignment statement and the print statement.
str
A Python data type that holds a string of characters.
value
A number or string (or other things to be named later) that can be stored in a variable or computed in an expression.
variable
A name that refers to a value.
variable name
A name given to a variable. Variable names in Python consist of a sequence of letters (a..z, A..Z, and _) and digits (0..9) that begins with a letter. In best programming practice, variable names should be chosen so that they describe their use in the program, making the program self documenting.
attribute
state or value that belongs to a particular object. for example, slim (turtle) has a color.
canvas
a surface within a window where drawing takes place
for loop
a statement in python for convenient repetition of statements in the body of the loop
instance
an object that belongs to a class. slim and cujo are instances of the the class Turtle in the module turtle
invoke
an object has methods. the verb invoke means to activate a method. Invoking a method is done by adding parentheses after the method name and perhaps passing arguments; e.g. window.exitonclick() is an invocation of the exitonclick method
iteration
basic building blocks for algorithms. allows steps to be repeated. sometimes called looping. repeated execution of a sequence of statements
loop body
statements nested (indented) inside of a loop
loop variable
variable used as part of the for loop. it is assigned a different value for each iteration of the loop and is used as part of the terminating condition
method
a function attached to an object. invoking the method causes the object to respond in some way; e.g. move the turtle forward with slim.forward(50)
module
a file containing definitions and statements for use in other Python programs. the contents of a module are made available to the program using the import statement
object
a “thing” to which a variable can refer; e.g. slim = turtle.Turtle(). slim is object (and variable?!)
range
built-in function for generating sequences of integers. especially useful for a loop that needs to be generated a specific number of times (with the for loop)
sequential
the default behavior of a program; line-by-line processing of the algorithm
state
the collection of attribute values that a specific data object maintains
state
the collection of attribute values that a specific data object maintains
terminating condition
condition that, when it occurs, causes a loop to stop repeating its body; e.g. the for loop stops executing when there are no more elements to assign to the loop variable
Turtle
a data object used to create pictures (called turtle graphics)
deterministic
a process that is repeatable and predictable
documentation
a place where you can go to get information about the programming language