Chapter 3-4 Flashcards

(18 cards)

1
Q

A statement that creates a function

A

function definition

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

The first line of a function definition

A

header

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

The sequence of statements inside a function definition

A

body

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

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

A

function object

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

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

A

parameter

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

A statement that runs one or more statements, often repeatedly

A

loop

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

A variable defined inside a function, and which can only be accessed inside the function

A

local variable

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

A process for writing programs

A

development plan

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

A window used to display graphical elements including lines, circles, rectangles, and other shapes

A

canvas

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

The process of replacing something unnecessarily specific (like a number) with something appropriately general (like a variable or parameter)

A

generalization

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

The process of modifying a working program to improve function interfaces and other qualities of the code

A

refactoring

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

A requirement that should be satisfied by the caller before a function starts

A

precondition

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

A requirement that should be satisfied by the function before it ends

A

postcondition

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

A string enclosed in triple quotes that can span more than one line of a program

A

multiline string

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

A string that appears at the top of a function definition to document the function’s interface

A

docstring

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

A process for designing the interface of a function, which includes the parameters it should take

A

interface design

17
Q

An argument that includes the name of the parameter

A

keyword argument

18
Q

The process of transforming a sequence of statements into a function definition

A

encapsulation