Prelim 1 Flashcards
Argument
An argument is an expression that appears within the parentheses of a function call.
Assert statement
<assert> <boolean-expression>. If the boolean expression is true, the statement does nothing. If it is false, the expression produces an error and the program stops running.
</boolean-expression></assert>
Assignment statement
<variable> = <expression>. If the variable on the left hand side does not exist yet, it is created and stores the value of the expression inside. If the variable does exist, it replaces the old value stored inside the variable with the value of the expression.
</expression></variable>
Attribute
A variable that is stored inside an object. Attributes typically have invariants, rules specifying how they can be modified.
Call Frame
A formal representation of what Python uses when you execute a function call. It contains the name of the function, parameters, local variables and a counter.
Call Stack
All of the call frames of the currently executing function call
Class
Any type that is not built-in to python
Constructor
A function that creates a mutable object. It puts the object in heap space and returns the name of the object so you can store it in a variable.
Expression
Python code that produces a value. They must be put inside a statement.
Function
A parameterized sequence of statements that perform a task.
Fruitful Function
A function that returns a value.
Function Call
Expression that executes a function body
Function Header
The first line of a function definition. It includes the keyword def, name of function, parameters within parentheses (if appropriate), and a colon.
Global Space
Area of memory that stores variables defined outside the body of a function.
Heap Space
Area of memory that stores mutable objects.