Chapters 2, 3, 5 & 6 Flashcards
Creating a new variable and giving it a value is called what?
An Assignment Statement
The “” diagram helps you see what state a variable is in.
state diagram
An ““is a combination of values, variables, and operators.
**expression **
A “” is a unit of code that has an effect, like creating a variable or displaying a
value.
statement
A mode where you interact directly with the interpreter. Hint: It’s not script
interactive mode
When an expression contains more than one operator, the order of evaluation depends on the?
order of operations
The + operator performs string “”, which means it joins the strings by linking them end-to-end.
** concatenation**
This error is called “” because it doesn’t appear until after the program has started.
Runtime error
If there is a “ “ in your program, it will run without generating error
messages, but it will not do the right thing.
semantic error
To run a statement and do what it says.
execute
A named sequence of statements that performs a computation.
function
A “” is a file that contains a collection of related functions.
module
The “ “ contains the functions and variables defined in the module.
module object
The argument of a function can be any kind of “ “, including arithmetic operators:
expression
A “ “ specifies the name of a new function and the sequence of statements that run when the function is called.
function definition
The first line of the function definition is called the “ “; the rest is called the “ “.
header and body
Defining a function creates a function “”, which has type function.
object
To ensure that a function is defined before its first use, you have to know the order statements run in, which is called the “ “.
flow of execution
Inside a function, the arguments are assigned to variables called “”.
parameters
“A pair a meters”
When you create a variable inside a function, it is “”
local
” “ show the value of each variable, but they
also show the function each variable belongs to.
stack diagrams
In a stack diagram, a “” is a box with the name of a function beside it and the parameters and variables of the function inside it.
frame
A function that returns results is called a “ “ and a function that performs and action but doesn’t return a value is called?
fruitful or void function
“print into the void”
“return to fruit”
A statement that reads a module file and creates a module object.
import statement
The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.
dot notation
A list of the functions that are executing, printed when an exception occurs.
traceback
The floor “ “, //, divides two numbers and rounds down to an integer.
division operator
An expression that is either true or false.
Boolean expression
The == operator is one of the “” operators.
relational
and, or, and not in Python are called?
logical operators
The boolean expression after if is called the “”.
condition
In an if statement, a header followed by an indented body is referred to as?
compound statement
An if statement with more than one possibility.
chained conditional
if x < y:
print(‘x’)
elif x > y:
print(‘y’)
else:
print(‘x and y’)
A function that calls itself is?
recursive
“read cursive”
In a stack diagram, the bottom of the stack is called?
base case. It does not make a recursive call, so there are no more frames.