Chapter 3 Functions Flashcards

1
Q

Function

A

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.

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

Function Definition

A

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

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

Function Object

A

A value created by a function definition. The name of the function is a variable that refers to a function object.

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

Header

A

The first line of a function definition.

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

Body

A

The sequence of statements inside a function definition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
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
7
Q

Function Call

A

A statement that runs a function. It consists of the function name followed by an argument list in parentheses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
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
10
Q

Return Value

A

The result of a function. If a function call is used as an expression, the return value is the value of the expression.

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

Fruitful function

A

A function that returns a value.

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

Void Function

A

A function that always returns None.

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

None

A

A special value returned by void functions.

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

Module

A

A file that contains a collection of related functions and other definitions.

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

Import Statement

A

A statement that reads a module file and creates a module object.

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

Module Object

A

A value created by an import Statement that provides access to the values defined in a module.

17
Q

Dot Notation

A

The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.

18
Q

Composition

A

Using an expression as a part of a larger expression or statement as part of a larger statement.

19
Q

Flow of Execution

A

The order statements run in.

20
Q

Stack diagram

A

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

21
Q

Frame

A

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

22
Q

Traceback

A

A list of the functions that are executing, printed when an exception occurs.