12.16. GlossaryΒΆ

argumentΒΆ

A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function. The argument can be the result of an expression which may involve operators, operands and calls to other fruitful functions.

bodyΒΆ

The second part of a compound statement. The body consists of a sequence of statements all indented the same amount from the beginning of the header. The standard amount of indentation used within the Python community is 4 spaces.

calling stackΒΆ

A sequence (stack) of frames, showing all the function calls that are in process but not yet complete. When one function’s code invokes another function call, there will be more than one frame on the stack.

compound statementΒΆ

A statement that consists of two parts:

  1. header - which begins with a keyword determining the statement type, and ends with a colon.

  2. body - containing one or more statements indented the same amount from the header.

The syntax of a compound statement looks like this:

keyword expression:
    statement
    statement
    ...
docstringΒΆ

If the first thing in a function body is a string (or, we’ll see later, in other situations too) that is attached to the function as its __doc__ attribute.

flow of executionΒΆ

The order in which statements are executed during a program run.

functionΒΆ

A named sequence of statements that performs some useful operation. Functions may or may not take parameters and may or may not produce a result.

function callΒΆ

A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses.

function compositionΒΆ

Using the output from one function call as the input to another.

function definitionΒΆ

A statement that creates a new function, specifying its name, parameters, and the statements it executes.

fruitful functionΒΆ

A function that returns a value when it is called.

global variableΒΆ

A variable defined at the top level, not inside any function.

header lineΒΆ

The first part of a compound statement. A header line begins with a keyword and ends with a colon (:)

lifetimeΒΆ

Variables and objects have lifetimes β€” they are created at some point during program execution, and will be destroyed at some time. In python, objects live as long as there is some variable pointing to it, or it is part of some other compound object, like a list or a dictionary. In python, local variables live only until the function finishes execution.

local variableΒΆ

A variable defined inside a function. A local variable can only be used inside its function. Parameters of a function are also a special kind of local variable.

methodΒΆ

A special kind of function that is invoked on objects of particular types of objects, using the syntax <expr>.<methodname>(<additional parameter values>)

NoneΒΆ

A special Python value. One use in Python is that it is returned by functions that do not execute a return statement with a return argument.

parameterΒΆ

A name used inside a function to refer to the value which was passed to it as an argument.

return valueΒΆ

The value provided as the result of a function call.

side effectΒΆ

Some lasting effect of a function call, other than its return value. Side effects include print statements, changes to mutable objects, and changes to the values of global variables.

stack frameΒΆ

A frame that keeps track of the values of local variables during a function execution, and where to return control when the function execution completes.

type annotationΒΆ

An optional notation that specifies the type of a function parameter or function result.

You have attempted of activities on this page