Chapter 3 Flashcards

1
Q

argument

A

A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

body

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

compound statement

A

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 …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

flow of execution

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

frame

A

A box in a stack diagram that represents a function call. It contains the local variables and parameters of the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

function

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

function call

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

function composition

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

function definition

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

header

A

The first part of a compound statement. Headers begin with a keyword and end with a colon (:)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

import

A

A statement which permits functions and variables defined in a Python script to be brought into the environment of another script or a running Python shell.
*Note that you do not include the .py from the script name in the import statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

local variable

A

A variable defined inside a function. A local variable can only be used inside its function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

parameter

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

stack diagram

A

A graphical representation of a stack of functions, their variables, and the values to which they refer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

traceback

A

A list of the functions that are executing, printed when a runtime error occurs. A traceback is also commonly refered to as a stack trace, since it lists the functions in the order in which they are stored in the runtime stack.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly