A conditional statement that appears in one of the branches of another conditional statement.
Back
operator
Front
A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
Back
return value
Front
The result of a function. If a function call is used as an expression, the return value is the value of the expression.
Back
conditional statement
Front
A statement that controls the flow of execution depending on some condition. An "if" statement.
Back
logical operator
Front
One of the operators that combines boolean expressions: and, or, and not.
Back
initialize
Front
An assignment that gives an initial value to a variable that will be updated.
Back
parse
Front
To examine a program and analyze the syntactic structure.
Back
accumulator
Front
A variable used in a loop to add up or accumulate a result.
Back
short circuit
Front
When Python is part-way through evaluating a logical expression and stops the evaluation because Python knows the final value for the expression without needing to evaluate the rest of the expression.
Back
concatenate
Front
To join two operands end to end.
Back
counter
Front
A variable used in a loop to count the number of times something happened. We initialize a counter to zero and then increment the counter each time we want to "count" something.
Back
expression
Front
A combination of variables, operators, and values that represents a single result value.
Back
pseudorandom
Front
Pertaining to a sequence of numbers that appear to be random, but are generated by a deterministic program.
Back
fruitful function
Front
A function that returns a value.
Back
type
Front
A category of values. The types we have seen so far are integers (type int), floating-point numbers (type float), and strings (type str).
Back
portability
Front
A property of a program that can run on more than one kind of computer.
Back
evaluate
Front
To simplify an expression by performing the operations in order to yield a single value.
Back
function call
Front
A statement that executes a function. It consists of the function name followed by an argument list.
Back
increment
Front
An update that increases the value of a variable (often by one).
Back
assignment
Front
A statement that assigns a value to a variable.
Uses a single "=" sign
x = 5
Back
semantics
Front
The meaning of a program.
Back
statement
Front
A section of code that represents a command or action.
Back
function definition
Front
A statement that creates a new function, specifying its name, parameters, and the statements it executes.
Back
semantic error
Front
An error in a program that makes it do something other than what the programmer intended.
Back
deterministic
Front
Pertaining to a program that does the same thing each time it runs, given the same inputs.
Back
parameter
Front
A name used inside a function to refer to the value passed as an argument.
Back
function
Front
A named sequence of statements that performs some useful operation. Functions may or may not take arguments and may or may not produce a result.
Back
body
Front
The sequence of statements inside a function definition.
Back
compound statement
Front
A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header. Example:
if ________:
------------
------------
else:
--------------
Back
composition
Front
Using an expression as part of a larger expression, or a statement as part of a larger statement.
Back
boolean expression
Front
An expression whose value is either True or False.
Usually contains a comparison operator: ==, !=, >, <, >=, <=, is, is not
Back
comment
Front
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.
- Uses "#" at beginning. Everything after the "#" is ignored.
- Can be at the beginning of a line and take the whole line
- Can be after a programming statement, explaining the statement
Back
guardian pattern
Front
Where we construct a logical expression with additional comparisons (like try/except) to take advantage of the short-circuit behavior (to keep from getting 0 in a denominator.
Back
prompt
Front
When a program displays a message and pauses for the user to type some input to the program.
Back
dot notation
Front
The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.
Back
condition
Front
The boolean expression in a conditional statement that determines which branch is executed.
Back
function object
Front
A value created by a function definition. The name of the function is a variable that refers to a function object.
Back
header
Front
The first line of a function definition.
Back
modulus operator
Front
An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.
Back
import statement
Front
A statement that reads a module file and creates a module object.
Back
flow of execution
Front
The order in which statements are executed during a program run.
Back
argument
Front
A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function, within the parentheses.
Back
decrement
Front
An update that decreases the value of a variable.
Back
problem solving
Front
The process of formulating a problem, finding a solution, and expressing the solution.
Back
operand
Front
One of the values on which an operator operates.
Back
algorithm
Front
A methodical step-by-step process for solving a category of problems.
Back
comparison operator
Front
One of the operators that compares its operands: ==, !=, >, <, >=, and <=.
Back
traceback
Front
A list of the functions that are executing, printed when an exception occurs.
Back
void function
Front
A function that does not return a value.
Back
module object
Front
A value created by an import statement that provides access to the data and code defined in a module.
Back
Section 2
(2 cards)
iteration
Front
Repeated execution of a set of statements using either a function that calls itself or a loop.
Back
infinite loop
Front
A loop in which the terminating condition is never satisfied or for which there is no terminating condition.